Skip to content

Commit c0b05de

Browse files
committed
Merge branch 'master' into pr/153
2 parents a6d9e3b + 7451fc6 commit c0b05de

63 files changed

Lines changed: 5375 additions & 5758 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.asf-release/.gitkeep

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# ---
19+
# This directory is used as apart of the release process.
20+
# Package tarballs will be generated in stored temporarily
21+
# within this directory and should not be commited to repo.
22+
# ---

.asf.yaml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,44 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
github:
19+
description: Apache Cordova - Xcode Node
20+
homepage: https://cordova.apache.org/
21+
22+
labels:
23+
- cordova
24+
- mobile
25+
- ios
26+
- javascript
27+
- nodejs
28+
- hacktoberfest
29+
30+
features:
31+
wiki: false
32+
issues: true
33+
projects: true
34+
35+
enabled_merge_buttons:
36+
squash: true
37+
merge: false
38+
rebase: false
39+
40+
rulesets:
41+
- name: "Default Branch Protection"
42+
type: branch
43+
branches:
44+
includes:
45+
- "~DEFAULT_BRANCH"
46+
- "release/*"
47+
- "rel/*"
48+
excludes: []
49+
bypass_teams:
50+
- root
51+
restrict_deletion: true
52+
restrict_force_push: true
53+
1854
notifications:
19-
commits: commits@cordova.apache.org
20-
issues: issues@cordova.apache.org
21-
pullrequests_status: issues@cordova.apache.org
55+
commits: commits@cordova.apache.org
56+
issues: issues@cordova.apache.org
57+
pullrequests_status: issues@cordova.apache.org
2258
pullrequests_comment: issues@cordova.apache.org

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ jobs:
4444
os: [ubuntu-latest, macos-15]
4545

4646
steps:
47-
- uses: actions/checkout@v6
47+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
48+
with:
49+
persist-credentials: false
50+
fetch-depth: 1
4851

49-
- name: Use Node.js ${{ matrix.node.version }}
50-
uses: actions/setup-node@v6
52+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
5153
with:
5254
node-version: ${{ matrix.node.version }}
5355

@@ -56,7 +58,7 @@ jobs:
5658
node --version
5759
npm --version
5860
59-
- uses: github/codeql-action/init@v4
61+
- uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
6062
with:
6163
languages: javascript
6264
queries: security-and-quality
@@ -70,10 +72,9 @@ jobs:
7072
env:
7173
CI: true
7274

73-
- uses: github/codeql-action/analyze@v4
75+
- uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
7476

75-
# v4.6.0
76-
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
77+
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
7778
if: success()
7879
with:
7980
name: ${{ runner.os }} node.js ${{ matrix.node.version }}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Draft Release
19+
20+
on:
21+
push:
22+
tags:
23+
- 'draft/**'
24+
25+
permissions:
26+
contents: read
27+
id-token: write
28+
29+
jobs:
30+
upload-to-atr:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
35+
with:
36+
persist-credentials: false
37+
fetch-depth: 1
38+
39+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
40+
with:
41+
node-version: 24
42+
package-manager-cache: false
43+
cache: ''
44+
45+
- name: Setup environment variables
46+
run: |
47+
REPO_NAME="${GITHUB_REPOSITORY#*/}"
48+
TAG_NAME="${GITHUB_REF#refs/tags/}"
49+
TARGET_RELEASE_VERSION="${TAG_NAME#draft/}"
50+
SRC_PACKAGE_NAME=${REPO_NAME}-source-${TARGET_RELEASE_VERSION}
51+
SRC_PACKAGE_TAR=${SRC_PACKAGE_NAME}.tar
52+
SRC_PACKAGE_TAR_GZ=${SRC_PACKAGE_NAME}.tar.gz
53+
SRC_PACKAGE_ZIP=${SRC_PACKAGE_NAME}.zip
54+
NPM_PACKAGE_NAME=${REPO_NAME}-npm-${TARGET_RELEASE_VERSION}
55+
56+
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
57+
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
58+
echo "TARGET_RELEASE_VERSION=$TARGET_RELEASE_VERSION" >> $GITHUB_ENV
59+
echo "SRC_PACKAGE_NAME=$SRC_PACKAGE_NAME" >> $GITHUB_ENV
60+
echo "SRC_PACKAGE_TAR=$SRC_PACKAGE_TAR" >> $GITHUB_ENV
61+
echo "SRC_PACKAGE_TAR_GZ=$SRC_PACKAGE_TAR_GZ" >> $GITHUB_ENV
62+
echo "SRC_PACKAGE_ZIP=$SRC_PACKAGE_ZIP" >> $GITHUB_ENV
63+
echo "NPM_PACKAGE_NAME=$NPM_PACKAGE_NAME" >> $GITHUB_ENV
64+
65+
echo "REPO_NAME=$REPO_NAME"
66+
echo "TAG_NAME=$TAG_NAME"
67+
echo "TARGET_RELEASE_VERSION=$TARGET_RELEASE_VERSION"
68+
echo "SRC_PACKAGE_NAME=$SRC_PACKAGE_NAME"
69+
echo "SRC_PACKAGE_TAR=$SRC_PACKAGE_TAR"
70+
echo "SRC_PACKAGE_TAR_GZ=$SRC_PACKAGE_TAR_GZ"
71+
echo "SRC_PACKAGE_ZIP=$SRC_PACKAGE_ZIP"
72+
echo "NPM_PACKAGE_NAME=$NPM_PACKAGE_NAME"
73+
74+
- name: Verify Target Release Version
75+
run: |
76+
PACKAGE_VERSION=$(jq -r '.version' package.json)
77+
if [ "$PACKAGE_VERSION" != "$TARGET_RELEASE_VERSION" ]; then
78+
echo "Mismatch version detected between tag version ($TARGET_RELEASE_VERSION) and package version ($PACKAGE_VERSION)"
79+
exit 1
80+
fi
81+
82+
if [ -f "plugin.xml" ]; then
83+
PLUGIN_VERSION=$(yq -p=xml -o=json '.plugin.+@version' plugin.xml | jq -r .)
84+
if [ "$PLUGIN_VERSION" != "$TARGET_RELEASE_VERSION" ]; then
85+
echo "Mismatch version detected between tag version ($TARGET_RELEASE_VERSION) and plugin version ($PLUGIN_VERSION)"
86+
exit 1
87+
fi
88+
fi
89+
90+
- name: Generate "tgz" npm convenience package
91+
run: |-
92+
npm ci
93+
NPM_PKG_NAME=$(npm pack --json | jq -r '.[0].filename')
94+
mv ./.asf-release/$NPM_PKG_NAME ./.asf-release/${NPM_PACKAGE_NAME}.tgz
95+
env:
96+
TZ: UTC
97+
98+
- name: Generate "tar" source package
99+
run: |-
100+
export SRC_LAST_COMMIT_EPOCH=$(git log -1 --format=%ct "$TAG_NAME")
101+
102+
git archive \
103+
--prefix=$SRC_PACKAGE_NAME/ \
104+
--mtime=$SRC_LAST_COMMIT_EPOCH \
105+
-o ./.asf-release/${SRC_PACKAGE_TAR} \
106+
$TAG_NAME
107+
env:
108+
TZ: UTC
109+
110+
- name: Generate "tar.gz" source archive
111+
working-directory: ./.asf-release
112+
run: |-
113+
gzip -n -9 -c "$SRC_PACKAGE_TAR" > "$SRC_PACKAGE_TAR_GZ"
114+
env:
115+
TZ: UTC
116+
117+
- name: Generate "zip" source archive
118+
working-directory: ./.asf-release
119+
run: |-
120+
export ASF_RELEASE_DIR=$(pwd)
121+
export TMP_DIR=$(mktemp -d)
122+
123+
tar -xf "$SRC_PACKAGE_TAR" -C "$TMP_DIR"
124+
(
125+
cd "$TMP_DIR"
126+
find . -type f | LC_ALL=C sort | zip -X -q "$ASF_RELEASE_DIR/$SRC_PACKAGE_ZIP" -@
127+
)
128+
rm -rf $TMP_DIR
129+
env:
130+
TZ: UTC
131+
132+
- name: Cleanup Process
133+
working-directory: ./.asf-release
134+
run: |-
135+
rm -rf $SRC_PACKAGE_TAR
136+
rm -rf .gitkeep
137+
138+
- name: Create Sign and Checksum
139+
working-directory: .asf-release
140+
run: |-
141+
for f in *.tar.gz *.tgz *.zip; do
142+
[ -e "$f" ] || continue
143+
echo "$CORDOVA_GPG_SECRET_KEY" | gpg --batch --import --import-options import-show
144+
gpg --armor --detach-sign "$f"
145+
sha512sum "$f" > "${f}.sha512"
146+
done
147+
env:
148+
CORDOVA_GPG_SECRET_KEY: ${{ secrets.CORDOVA_GPG_SECRET_KEY }}
149+
150+
- name: Upload to Apache Trusted Release (ATR)
151+
uses: apache/tooling-actions/upload-to-atr@f5f4c0e7ddfbde6b1f8288cef36324c6def68051
152+
with:
153+
project: ${{ env.REPO_NAME }}
154+
version: ${{ env.TARGET_RELEASE_VERSION }}
155+
src: .asf-release

.github/workflows/release-audit.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,25 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
# Checkout project
37-
- uses: actions/checkout@v6
37+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38+
with:
39+
persist-credentials: false
40+
fetch-depth: 1
3841

39-
# Check license headers (v2.0.0)
40-
- uses: erisu/apache-rat-action@46fb01ce7d8f76bdcd7ab10e7af46e1ea95ca01c
42+
# Check license headers
43+
- uses: erisu/apache-rat-action@30c94d10ed21e6f6fd5590dc5c158f58cae7a0dd # v3.0.0
4144

4245
# Setup environment with node
43-
- uses: actions/setup-node@v6
46+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4447
with:
4548
node-version: 24
4649

4750
# Install node packages
4851
- name: npm install packages
4952
run: npm ci
5053

51-
# Check node package licenses (v2.0.1)
52-
- uses: erisu/license-checker-action@99cffa11264fe545fd0baa6c13bca5a00ae608f2
54+
# Check node package licenses
55+
- uses: erisu/license-checker-action@04511f4c052b5773f11e1c65b42cda88235c62ae # v2.1.0
5356
with:
5457
license-config: 'licence_checker.yml'
5558
include-asf-category-a: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ npm-debug.log
2121
coverage
2222
.nyc_output
2323
lcov.info
24+
25+
# ASF release workspace
26+
.asf-release/
27+
!.asf-release/.gitkeep

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@
1818
.*
1919
coverage
2020
test
21+
eslint.config.js
22+
licence_checker.yml
23+
24+
# ASF release workspace
25+
.asf-release/

.npmrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@
1616
# under the License.
1717

1818
registry=https://registry.npmjs.org
19+
20+
# ASF release settings
21+
git-tag-version=false
22+
preid=dev
23+
pack-destination=./.asf-release
File renamed without changes.

eslint.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
20+
const { defineConfig, globalIgnores } = require('eslint/config');
21+
const nodeConfig = require('@cordova/eslint-config/node');
22+
const nodeTestConfig = require('@cordova/eslint-config/node-tests');
23+
24+
module.exports = defineConfig([
25+
globalIgnores([
26+
'lib/parser/pbxproj.js'
27+
]),
28+
...nodeConfig,
29+
...nodeTestConfig.map(config => ({
30+
files: ['test/**/*.js'],
31+
...config
32+
}))
33+
]);

0 commit comments

Comments
 (0)