Skip to content

Commit 6286e82

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/windows
# Conflicts: # lib/common/bootstrap.ts # lib/constants.ts # package-lock.json # package.json # packages/doctor/src/doctor.ts # packages/doctor/src/index.ts
2 parents c80a64b + 3cde060 commit 6286e82

284 files changed

Lines changed: 27217 additions & 12751 deletions

File tree

Some content is hidden

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

‎.env.example‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Environment used to build and release the CLI.
2+
#
3+
# Copy to .env and fill in what you need; .env is gitignored, .env.example is not.
4+
# The build scripts load .env automatically, but a value already exported in the
5+
# environment always wins - CI secrets are never shadowed by a stray local file.
6+
7+
8+
# --- Analytics -------------------------------------------------------------
9+
# Measurement Protocol api secret, paired with the measurement id in
10+
# scripts/set-ga-id.js. Create one under
11+
# GA4 Admin -> Data Streams -> <stream> -> Measurement Protocol API secrets
12+
#
13+
# Deliberately not committed: this repository is public, so a committed secret
14+
# would make every contributor's `npm run pack.release` report into the
15+
# production property. Leave it unset locally - builds then report nothing.
16+
#
17+
# Set as the GA_API_SECRET repository secret for releases.
18+
GA_API_SECRET=
19+
20+
# Same, for the dev measurement id. Unused until a dev id is set in
21+
# scripts/set-ga-id.js.
22+
GA_API_SECRET_DEV=
23+
24+
25+
# --- Publishing ------------------------------------------------------------
26+
# Only needed when the USE_NPM_TOKEN repository variable is "true". The default
27+
# path is OIDC trusted publishing, which needs no token at all.
28+
NPM_PUBLISH_TOKEN=
29+
30+
# Used by the OpenSSF Scorecard workflow to read branch protection rules.
31+
SCORECARD_TOKEN=
32+
33+
# GITHUB_TOKEN is provided by Actions automatically and never needs setting here.

‎.github/workflows/codeql-advanced.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
6161
steps:
6262
- name: Checkout repository
63-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
63+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6464

6565
# Add any setup steps before running the `github/codeql-action/init` action.
6666
# This includes steps like installing compilers or runtimes (`actions/setup-node`
@@ -70,7 +70,7 @@ jobs:
7070

7171
# Initializes the CodeQL tools for scanning.
7272
- name: Initialize CodeQL
73-
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
73+
uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
7474
with:
7575
languages: ${{ matrix.language }}
7676
build-mode: ${{ matrix.build-mode }}
@@ -98,6 +98,6 @@ jobs:
9898
exit 1
9999
100100
- name: Perform CodeQL Analysis
101-
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
101+
uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
102102
with:
103103
category: "/language:${{matrix.language}}"

‎.github/workflows/dependency-review.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: 'Checkout Repository'
20-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.3.0
20+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4.3.0
2121
- name: 'Dependency Review'
22-
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
22+
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0

‎.github/workflows/npm_release_cli.yml‎

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ on:
1111
workflow_dispatch:
1212
inputs:
1313
release_type:
14-
description: 'Release type. "dev" publishes a -next prerelease without bumping package.json. patch/minor/major/prerelease bump package.json, commit + tag to main, then publish as a stable release.'
15-
type: choice
16-
options:
17-
- dev
18-
- patch
19-
- minor
20-
- major
21-
- prerelease
22-
default: patch
14+
description: >-
15+
Release to cut. Leave empty for a rolling "next" prerelease (no version
16+
bump). "dev" publishes a -dev prerelease (no bump). A semver keyword
17+
(patch/minor/major) or an explicit version (e.g. 9.1.0, 9.1.0-alpha.1)
18+
bumps package.json, commits + tags v<version>, then publishes a stable
19+
release. A prerelease version publishes under the dist-tag matching its
20+
prerelease id (alpha/beta/rc); a plain version publishes under "latest".
21+
type: string
22+
required: false
23+
default: ''
2324

2425
permissions: read-all
2526

@@ -39,16 +40,16 @@ jobs:
3940

4041
steps:
4142
- name: Harden the runner (Audit all outbound calls)
42-
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
43+
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
4344
with:
4445
egress-policy: audit
4546

46-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
47+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4748
with:
4849
fetch-depth: 0
4950
token: ${{ secrets.GITHUB_TOKEN }}
5051

51-
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
52+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
5253
with:
5354
node-version: 22.14.0
5455
registry-url: "https://registry.npmjs.org"
@@ -62,17 +63,22 @@ jobs:
6263
echo NPM_VERSION=$NPM_VERSION >> $GITHUB_ENV
6364
6465
- name: Bump, commit and tag stable release (manual dispatch)
65-
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_type != 'dev' }}
66+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_type != '' && inputs.release_type != 'dev' }}
67+
env:
68+
# env indirection keeps the free-text dispatch input out of shell interpolation
69+
RELEASE_INPUT: ${{ inputs.release_type }}
6670
run: |
6771
git config user.name "github-actions[bot]"
6872
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
69-
npm version ${{ inputs.release_type }} -m "chore: release v%s"
73+
# npm version accepts a semver keyword (patch/minor/major) or an explicit
74+
# version; strip an optional leading "v" so v9.1.0 and 9.1.0 both work.
75+
npm version "${RELEASE_INPUT#v}" -m "chore: release v%s"
7076
NPM_VERSION=$(node -e "console.log(require('./package.json').version);")
7177
echo NPM_VERSION=$NPM_VERSION >> $GITHUB_ENV
7278
git push origin HEAD:${GITHUB_REF_NAME} --follow-tags
7379
7480
- name: Bump version for dev release
75-
if: ${{ !contains(github.ref, 'refs/tags/') && (github.event_name != 'workflow_dispatch' || inputs.release_type == 'dev') }}
81+
if: ${{ !contains(github.ref, 'refs/tags/') && (github.event_name != 'workflow_dispatch' || inputs.release_type == '' || inputs.release_type == 'dev') }}
7682
env:
7783
NPM_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.release_type == 'dev' && 'dev' || 'next' }}
7884
run: |
@@ -82,9 +88,14 @@ jobs:
8288
8389
- name: Output NPM Version and tag
8490
id: npm_version_output
91+
env:
92+
# true only for a manual dispatch that cut a real (bumped) release — not
93+
# the empty "next" build or the "dev" channel. Computed in the GitHub
94+
# expression context so the free-text input never reaches the shell.
95+
IS_DISPATCH_RELEASE: ${{ github.event_name == 'workflow_dispatch' && inputs.release_type != '' && inputs.release_type != 'dev' }}
8596
run: |
8697
NPM_TAG=$(node ./scripts/get-npm-tag.js)
87-
if [[ "${GITHUB_REF}" == refs/tags/* ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.release_type }}" != "dev" ]]; then
98+
if [[ "${GITHUB_REF}" == refs/tags/* ]] || [[ "$IS_DISPATCH_RELEASE" == "true" ]]; then
8899
IS_RELEASE=true
89100
else
90101
IS_RELEASE=false
@@ -93,8 +104,18 @@ jobs:
93104
echo NPM_TAG=$NPM_TAG >> $GITHUB_OUTPUT
94105
echo IS_RELEASE=$IS_RELEASE >> $GITHUB_OUTPUT
95106
107+
- name: Check analytics is configured
108+
env:
109+
GA_API_SECRET: ${{ secrets.GA_API_SECRET }}
110+
run: |
111+
if [ -z "$GA_API_SECRET" ]; then
112+
echo "::warning::GA_API_SECRET is not set, so this release reports no analytics."
113+
fi
114+
96115
- name: Build nativescript
97-
run: npm pack
116+
env:
117+
GA_API_SECRET: ${{ secrets.GA_API_SECRET }}
118+
run: npm run pack.release
98119

99120
- name: Upload npm package artifact
100121
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
@@ -115,11 +136,11 @@ jobs:
115136
NPM_TAG: ${{needs.build.outputs.npm_tag}}
116137
steps:
117138
- name: Harden the runner (Audit all outbound calls)
118-
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
139+
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
119140
with:
120141
egress-policy: audit
121142

122-
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
143+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
123144
with:
124145
node-version: 22.14.0
125146
registry-url: "https://registry.npmjs.org"
@@ -166,16 +187,16 @@ jobs:
166187
NPM_VERSION: ${{needs.build.outputs.npm_version}}
167188
steps:
168189
- name: Harden the runner (Audit all outbound calls)
169-
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
190+
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
170191
with:
171192
egress-policy: audit
172193

173-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
194+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
174195
with:
175196
fetch-depth: 0
176197
ref: v${{needs.build.outputs.npm_version}}
177198

178-
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
199+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
179200
with:
180201
node-version: 22.14.0
181202

0 commit comments

Comments
 (0)