@@ -3,38 +3,20 @@ name: Release
33on :
44 workflow_dispatch :
55 inputs :
6- releaseType :
7- type : choice
8- description : Release type
6+ dryRun :
7+ description : ' Do a dry run to preview instead of a real release'
98 required : true
10- default : dry-run
11- options :
12- - release
13- - dry-run
9+ default : ' true'
1410
1511jobs :
1612 authorize :
1713 name : Authorize
1814 runs-on : ubuntu-latest
1915 steps :
20- - name : Check branch protection
21- run : |
22- if [ "${{ github.event.inputs.releaseType }}" == "dry-run" ]; then
23- echo "✅ Branch check skipped: dry-run mode allows any branch"
24- echo "Current branch: ${{ github.ref_name }}"
25- exit 0
26- fi
27- if [ "${{ github.ref_name }}" != "v8.x" ]; then
28- echo "❌ This workflow can only be triggered from the v8.x branch."
29- echo "Current branch: ${{ github.ref_name }}"
30- exit 1
31- fi
32- echo "✅ Branch check passed: running from v8.x"
33-
3416 - name : ${{ github.actor }} permission check to do a release
35- uses : ' lannonbr/repo-permission-check-action@2.0.2'
17+ uses : " lannonbr/repo-permission-check-action@2.0.2"
3618 with :
37- permission : ' write'
19+ permission : " write"
3820 env :
3921 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4022
@@ -43,22 +25,17 @@ jobs:
4325 runs-on : ubuntu-latest
4426 needs : [authorize]
4527 permissions :
46- id-token : write # Required for OIDC
28+ id-token : write
4729 contents : write
4830 env :
4931 GIT_AUTHOR_NAME : amplitude-sdk-bot
5032 GIT_AUTHOR_EMAIL : amplitude-sdk-bot@users.noreply.github.com
5133 GIT_COMMITTER_NAME : amplitude-sdk-bot
5234 GIT_COMMITTER_EMAIL : amplitude-sdk-bot@users.noreply.github.com
53- strategy :
54- matrix :
55- node-version : [24.x] # Ensure npm 11.5.1 or later is installed for OIDC
5635
5736 steps :
5837 - name : Checkout
59- uses : actions/checkout@v3
60- with :
61- fetch-depth : 0
38+ uses : actions/checkout@v1
6239
6340 - name : Configure AWS Credentials
6441 uses : aws-actions/configure-aws-credentials@v1
@@ -76,14 +53,13 @@ jobs:
7653 uses : actions/setup-python@v2
7754 with :
7855 python-version : ' 3.8.x'
79-
8056 - name : Install boto3 for deploy_s3.python
8157 run : pip install boto3==1.14.63
8258
8359 - name : Setup Node.js
8460 uses : actions/setup-node@v3
8561 with :
86- node-version : ${{ matrix.node-version }}
62+ node-version : 16.x
8763
8864 - name : Install dependencies
8965 run : yarn install --frozen-lockfile
@@ -92,15 +68,17 @@ jobs:
9268 run : make test
9369
9470 - name : Release --dry-run # Uses release.config.js
95- if : ${{ github.event.inputs.releaseType == 'dry-run' }}
71+ if : ${{ github.event.inputs.dryRun == 'true' }}
9672 env :
9773 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
9875 S3_BUCKET_NAME : ${{ secrets.S3_BUCKET_NAME }}
9976 run : npx semantic-release --dry-run
10077
10178 - name : Release # Uses release.config.js
102- if : ${{ github.event.inputs.releaseType == 'release' }}
79+ if : ${{ github.event.inputs.dryRun == 'false' }}
10380 env :
10481 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
82+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
10583 S3_BUCKET_NAME : ${{ secrets.S3_BUCKET_NAME }}
10684 run : npx semantic-release
0 commit comments