Skip to content

Commit 4f6fd72

Browse files
committed
ci: fix release workflow - git push, split oidc from custom github app
1 parent 38b04e4 commit 4f6fd72

File tree

3 files changed

+49
-5
lines changed

3 files changed

+49
-5
lines changed

.github/workflows/publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*.*
7+
8+
concurrency:
9+
group: publish
10+
cancel-in-progress: false
11+
12+
# configured as trusted publisher (OIDC)
13+
# https://docs.npmjs.com/trusted-publishers
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
env:
19+
NX_NON_NATIVE_HASHER: true
20+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
21+
22+
jobs:
23+
publish:
24+
name: Publish packages
25+
runs-on: ubuntu-latest
26+
environment: release
27+
steps:
28+
- name: Clone the repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
- name: Configure Git user
33+
# https://github.com/actions/checkout/blob/main/README.md#push-a-commit-using-the-built-in-token
34+
run: |
35+
git config user.name github-actions[bot]
36+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
37+
- name: Set up Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version-file: .node-version
41+
cache: npm
42+
- name: Install dependencies
43+
run: npm ci
44+
- name: Publish packages to npm
45+
run: npx nx release publish

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
jobs:
1313
release:
14-
name: Publish packages
14+
name: Version and release
1515
runs-on: ubuntu-latest
1616
environment: release
1717
env:
@@ -38,15 +38,14 @@ jobs:
3838
with:
3939
fetch-depth: 0
4040
token: ${{ steps.app-token.outputs.token }}
41-
persist-credentials: false
4241
- name: Set up Node.js
4342
uses: actions/setup-node@v4
4443
with:
4544
node-version-file: .node-version
4645
cache: npm
4746
- name: Install dependencies
4847
run: npm ci
49-
- name: Version, release and publish packages
50-
run: npx nx release --yes
48+
- name: Version, release and generate changelog
49+
run: npx nx release --skip-publish
5150
env:
5251
GH_TOKEN: ${{ steps.app-token.outputs.token }}

nx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
"push": true,
333333
"pushRemote": "origin",
334334
"tag": true,
335-
"commitMessage": "release: {version} [skip ci]"
335+
"commitMessage": "release: {version}"
336336
},
337337
"version": {
338338
"conventionalCommits": true,

0 commit comments

Comments
 (0)