Skip to content

Commit 76e22ff

Browse files
authored
chore(cic-cd): rollback last commit
Updated the release workflow to improve package publishing and testing steps.
1 parent 8cace73 commit 76e22ff

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

.github/workflows/release.yaml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,57 @@
22

33
name: Release [Manual]
44
on: workflow_dispatch
5+
56
permissions:
67
contents: write
7-
id-token: write
8+
id-token: write # REQUIRED for trusted publishing
9+
810
jobs:
911
Release:
1012
runs-on: ubuntu-latest
13+
# Specify environment if you configured one in npm
14+
# environment: production # Uncomment if you set an environment name in npm trusted publisher settings
15+
1116
steps:
1217
- uses: actions/checkout@v3
1318
with:
1419
# fetch-depth is necessary to get all tags
1520
# otherwise lerna can't detect the changes and will end up bumping the versions for all packages
1621
fetch-depth: 0
1722
token: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
23+
1824
- name: Setup Node
19-
uses: actions/setup-node@v4
25+
uses: actions/setup-node@v4 # UPDATED to v4
2026
with:
2127
node-version: '22'
22-
registry-url: "https://registry.npmjs.org/"
23-
provenance: true # enables trusted publish via OIDC
28+
registry-url: 'https://registry.npmjs.org'
29+
always-auth: false # important for trusted publishing
30+
2431
- name: Configure CI Git User
2532
run: |
2633
git config --global user.name $CONFIG_USERNAME
2734
git config --global user.email $CONFIG_EMAIL
28-
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/sourcefuse/arc-saas
35+
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/sourcefuse/loopback4-authorization
2936
env:
3037
GITHUB_PAT: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
3138
CONFIG_USERNAME: ${{ vars.RELEASE_COMMIT_USERNAME }}
3239
CONFIG_EMAIL: ${{ vars.RELEASE_COMMIT_EMAIL }}
3340

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
41+
- name: Install 📌
42+
run: npm install
43+
44+
- name: Test 🔧
45+
run: npm run test
46+
47+
# ✅ CHANGED THIS SECTION
48+
- name: Semantic Publish to NPM 🚀
5449
run: |
55-
echo "🚀 Publishing packages from-package with provenance..."
56-
npx lerna publish from-package --yes --registry https://registry.npmjs.org/
50+
npm config set provenance true
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

0 commit comments

Comments
 (0)