Skip to content

Commit 17d2fe7

Browse files
authored
Merge pull request #19 from networkteam/feat-trusted-publishing
Feat: use trusted publishing
2 parents 4a0ea9c + 2bc5c0b commit 17d2fe7

2 files changed

Lines changed: 32 additions & 31 deletions

File tree

.github/workflows/release-next.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,46 @@
11
name: Release
22
on:
33
release:
4-
types: [created]
4+
types: [released]
5+
push:
6+
branches:
7+
- next
8+
9+
permissions:
10+
id-token: write
11+
contents: read
12+
513
jobs:
614
release:
715
runs-on: ubuntu-latest
16+
if: github.event_name == 'release' && github.event.action == 'released'
817
steps:
918
- uses: actions/checkout@v4
10-
- uses: actions/setup-node@v3
19+
- uses: actions/setup-node@v4
1120
with:
12-
node-version: '18.x'
21+
node-version: '24.x'
1322
cache: yarn
1423
registry-url: 'https://registry.npmjs.org'
1524
- run: yarn install
1625
- run: yarn build
1726
- run: npm publish
18-
env:
19-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
27+
28+
release-next:
29+
runs-on: ubuntu-latest
30+
if: github.ref == 'refs/heads/next'
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: '24.x'
36+
cache: yarn
37+
registry-url: 'https://registry.npmjs.org'
38+
- name: Set outputs
39+
id: vars
40+
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
41+
- run: git config --global user.name "GitHub CD bot"
42+
- run: git config --global user.email "info@networkteam.com"
43+
- run: npm version prerelease --preid=${{ steps.vars.outputs.sha_short }}
44+
- run: yarn install
45+
- run: yarn build
46+
- run: npm publish --tag next

0 commit comments

Comments
 (0)