Skip to content

Commit 8cace73

Browse files
authored
chore(cic-cd): update release yml file
Updated release workflow to improve package publishing and testing steps.
1 parent d183f89 commit 8cace73

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

.github/workflows/release.yaml

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,56 @@
11
# This Manually Executable Workflow is for NPM Releases
2+
23
name: Release [Manual]
34
on: workflow_dispatch
4-
55
permissions:
66
contents: write
7-
id-token: write # REQUIRED for trusted publishing
8-
7+
id-token: write
98
jobs:
109
Release:
1110
runs-on: ubuntu-latest
12-
# Specify environment if you configured one in npm
13-
# environment: production # Uncomment if you set an environment name in npm trusted publisher settings
14-
1511
steps:
1612
- uses: actions/checkout@v3
1713
with:
1814
# fetch-depth is necessary to get all tags
1915
# otherwise lerna can't detect the changes and will end up bumping the versions for all packages
2016
fetch-depth: 0
2117
token: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
22-
2318
- name: Setup Node
24-
uses: actions/setup-node@v4 # UPDATED to v4
19+
uses: actions/setup-node@v4
2520
with:
2621
node-version: '22'
27-
registry-url: 'https://registry.npmjs.org'
28-
always-auth: false # important for trusted publishing
29-
22+
registry-url: "https://registry.npmjs.org/"
23+
provenance: true # enables trusted publish via OIDC
3024
- name: Configure CI Git User
3125
run: |
3226
git config --global user.name $CONFIG_USERNAME
3327
git config --global user.email $CONFIG_EMAIL
34-
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/sourcefuse/loopback4-authorization
28+
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/sourcefuse/arc-saas
3529
env:
3630
GITHUB_PAT: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
3731
CONFIG_USERNAME: ${{ vars.RELEASE_COMMIT_USERNAME }}
3832
CONFIG_EMAIL: ${{ vars.RELEASE_COMMIT_EMAIL }}
3933

40-
- name: Install 📌
41-
run: npm install
42-
43-
- name: Test 🔧
44-
run: npm run test
45-
46-
# ✅ CHANGED THIS SECTION
47-
- name: Semantic Publish to NPM 🚀
34+
- name: Bootstrap
35+
run: npm ci
36+
# this step is added only since this version of nx dependency is not being installed on linux systems
37+
# can be removed once this issue is fixed or we update to later versions
38+
- name: nx dependency
39+
run: npm i @nx/[email protected]
40+
- name: Test
41+
run: npm run test --workspaces --if-present
42+
- name: Lint
43+
run: npm run lint --workspaces --if-present
44+
- name: Stash Changes
45+
run: git stash
46+
- name: Bump Versions
47+
# "HUSKY=0" disables pre-commit-msg check (Needed in order to allow lerna perform the release commit)
48+
# run: HUSKY=0 npx lerna version --yes --ci --conventional-commits
49+
# Bumping major version for release will remove once released
50+
run: HUSKY=0 npx lerna version --yes --ci --conventional-commits
51+
# 🟢 This replaces 'lerna publish from-package --yes --provenance'
52+
# and replicates its logic safely while keeping provenance and trusted publishing.
53+
- name: Publish all changed packages
4854
run: |
49-
npm config set provenance true
50-
51-
HUSKY=0 npx semantic-release
52-
env:
53-
GH_TOKEN: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
54-
# REMOVED: NPM_TOKEN is not needed with trusted publishing
55-
# The id-token: write permission above handles authentication
56-
57-
- name: Changelog 📝
58-
run: cd src/release_notes && HUSKY=0 node release-notes.js
55+
echo "🚀 Publishing packages from-package with provenance..."
56+
npx lerna publish from-package --yes --registry https://registry.npmjs.org/

0 commit comments

Comments
 (0)