Skip to content

Commit 1c6bf6a

Browse files
committed
chore: Publish beta versions to npm registry
1 parent b9f391b commit 1c6bf6a

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- master
6+
- beta
67

78
permissions:
89
contents: read # for checkout
@@ -28,8 +29,6 @@ jobs:
2829
run: npm audit signatures
2930
- name: Build and test
3031
run: npm run prepublishOnly
31-
32-
3332
release:
3433
name: Release
3534
runs-on: ubuntu-latest
@@ -58,3 +57,34 @@ jobs:
5857
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5958
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6059
run: npx semantic-release
60+
release-beta:
61+
name: Publish Beta
62+
runs-on: ubuntu-latest
63+
needs: build
64+
if: github.ref == 'refs/heads/beta'
65+
permissions:
66+
contents: write # to be able to publish a GitHub release
67+
issues: write # to be able to comment on released issues
68+
pull-requests: write # to be able to comment on released pull requests
69+
id-token: write # to enable use of OIDC for npm provenance
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v3
73+
with:
74+
fetch-depth: 0
75+
- name: Setup Node.js
76+
uses: actions/setup-node@v3
77+
with:
78+
node-version: "lts/*"
79+
- name: Install dependencies
80+
run: npm clean-install
81+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
82+
run: npm audit signatures
83+
- name: Set version env
84+
run: echo "NEXT_VERSION=$(git describe --tags --always --abbrev=7 | sed 's/$/-beta/')" >> $GITHUB_ENV
85+
- name: Set version
86+
run: npm version $NEXT_VERSION
87+
- name: Publish to npm
88+
env:
89+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
90+
run: npm publish --tag beta

0 commit comments

Comments
 (0)