@@ -4,11 +4,9 @@ name: Release [Manual]
44on : workflow_dispatch
55permissions :
66 contents : write
7- id-token : write
87jobs :
98 Release :
109 runs-on : ubuntu-latest
11- environment : npm-release
1210 steps :
1311 - uses : actions/checkout@v4
1412 with :
@@ -19,32 +17,33 @@ jobs:
1917 - name : Setup Node
2018 uses : actions/setup-node@v4
2119 with :
22- node-version : ' 22'
23- registry-url : " https://registry.npmjs.org/"
24- scope : ' @sourceloop'
25- provenance : true # enables trusted publish via OIDC
26- # - name: Force OIDC (disable npm token auth)
27- # run: |
28- # unset NPM_TOKEN
29- # unset NODE_AUTH_TOKEN
30- # npm config delete //registry.npmjs.org/:_authToken || true
20+ node-version : ' 24.x'
3121 - name : Configure CI Git User
3222 run : |
3323 git config --global user.name $CONFIG_USERNAME
3424 git config --global user.email $CONFIG_EMAIL
35- git remote set-url origin https://${GITHUB_ACTOR}:${GITHUB_PAT}@github.com/sourcefuse/arc-saas
36-
25+ git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_PAT@github.com/sourcefuse/arc-saas
3726 env :
3827 GITHUB_PAT : ${{ secrets.RELEASE_COMMIT_GH_PAT }}
3928 CONFIG_USERNAME : ${{ vars.RELEASE_COMMIT_USERNAME }}
4029 CONFIG_EMAIL : ${{ vars.RELEASE_COMMIT_EMAIL }}
30+ - name : Authenticate with Registry
31+ run : |
32+ echo "@${NPM_USERNAME}:registry=https://registry.npmjs.org/" > .npmrc
33+ echo "registry=https://registry.npmjs.org/" >> .npmrc
34+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
35+ npm whoami
36+ env :
37+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
38+ NPM_USERNAME : ${{ vars.NPM_USERNAME }}
4139
4240 - name : Install Dependencies
4341 run : npm ci --ignore-scripts
42+
4443 # this step is added only since this version of nx dependency is not being installed on linux systems
4544 # can be removed once this issue is fixed or we update to later versions
4645 - name : nx dependency
47- run : npm i @nx/nx-linux-x64-gnu@16.10.0
46+ run : npm i @nx/nx-linux-x64-gnu@16.10.0 --ignore-scripts
4847 - name : Test
4948 run : npm run test --workspaces --if-present
5049 - name : Lint
5453 - name : Bump Versions
5554 # "HUSKY=0" disables pre-commit-msg check (Needed in order to allow lerna perform the release commit)
5655 run : HUSKY=0 npx lerna version --yes --ci --conventional-commits
57- # run: HUSKY=0 npx lerna version --yes --ci --no-git-tag-version --force-publish
58- # and replicates its logic safely while keeping provenance and trusted publishing.
59- - name : Publish all changed packages with provenance
60- run : |
61- echo "🚀 Publishing packages"
62- npm publish -ws --provenance
56+ - name : Publish to NPM 🚀
57+ # To always compare changes from registry
58+ # using `from-package` compares version in local package.json with registry and publish it if required.
59+ run : npx lerna publish from-package --yes
60+ env :
61+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments