close
Skip to content

Commit 614d141

Browse files
committed
ci: allow prerelease publishing and limit android/ios test runs
1 parent d130ff8 commit 614d141

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

‎.github/workflows/build.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
test-ios:
5151
name: Test (iOS)
5252
runs-on: macos-15
53+
timeout-minutes: 20
5354
steps:
5455
- name: Setup Xcode
5556
uses: maxim-lobanov/setup-xcode@v1
@@ -74,6 +75,7 @@ jobs:
7475
test-android:
7576
name: Test (Android)
7677
runs-on: ubuntu-latest
78+
timeout-minutes: 20
7779
steps:
7880
- name: Checkout
7981
uses: actions/checkout@v6

‎.github/workflows/release.yml‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
options: [angular, zone-js]
1010
default: angular
1111
version:
12-
description: Version specifier (e.g. 22.0.0, patch, minor)
12+
description: Version specifier (e.g. 22.0.0, 22.0.0-rc.4, patch, minor)
1313
required: true
1414
dry-run:
1515
description: Dry run (preview only, no push/publish)
@@ -61,6 +61,31 @@ jobs:
6161
${{ inputs.dry-run && '--dry-run' || '' }}
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
# Prereleases (e.g. 22.0.0-rc.4) publish to their prerelease dist-tag (rc),
65+
# never latest. In a dry run keyword specifiers (patch/minor) resolve from
66+
# the unbumped manifest, so the previewed tag may differ from a real run.
67+
- name: Resolve npm dist-tag
68+
id: dist-tag
69+
shell: bash
70+
run: |
71+
set -euo pipefail
72+
spec='${{ inputs.version }}'
73+
if [[ "$spec" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then
74+
version="$spec"
75+
else
76+
version=$(node -p "require('./packages/${{ inputs.project }}/package.json').version")
77+
fi
78+
if [[ "$version" == *-* ]]; then
79+
pre="${version#*-}"
80+
tag="${pre%%.*}"
81+
if [[ "$tag" =~ ^[0-9]+$ ]]; then
82+
tag="next"
83+
fi
84+
else
85+
tag="latest"
86+
fi
87+
echo "Resolved version ${version} -> dist-tag ${tag}"
88+
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
6489
# OIDC trusted publishing (default): npm must find no token auth at all,
6590
# otherwise it uses the token instead of the OIDC exchange.
6691
- name: nx release publish (OIDC)
@@ -79,6 +104,7 @@ jobs:
79104
80105
npx nx release publish \
81106
--groups=${{ inputs.project }} \
107+
--tag "${{ steps.dist-tag.outputs.tag }}" \
82108
--access public \
83109
${{ inputs.dry-run && '--dry-run' || '' }}
84110
# Token fallback: only when explicitly enabled via repo variable USE_NPM_TOKEN=true.
@@ -90,5 +116,6 @@ jobs:
90116
run: >
91117
npx nx release publish
92118
--groups=${{ inputs.project }}
119+
--tag "${{ steps.dist-tag.outputs.tag }}"
93120
--access public
94121
${{ inputs.dry-run && '--dry-run' || '' }}

0 commit comments

Comments
 (0)