Skip to content

Commit 1c14fa3

Browse files
committed
ci: add github workflow to publish pre-release packages
1 parent fe78d23 commit 1c14fa3

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/pre-release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Pre-Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
pre-release:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- uses: actions/checkout@v6
11+
12+
- uses: actions/setup-node@v6
13+
with:
14+
node-version-file: .nvmrc
15+
registry-url: 'https://npm.pkg.github.com'
16+
scope: '@${{ github.repository_owner }}'
17+
18+
- name: Install dependencies
19+
run: npm ci --ignore-scripts
20+
21+
- name: Compile and test
22+
run: npm run ci
23+
24+
- name: Prepare pre release
25+
run: |
26+
git_sha=$(git rev-parse --short HEAD)
27+
mv package.json /tmp/package.json
28+
jq --arg git_sha ${git_sha} \
29+
'del(.repository)
30+
| .version = .version + "-" + $git_sha
31+
| .name = "@${{ github.repository_owner }}/" + .name' \
32+
/tmp/package.json > package.json
33+
34+
- run: npm publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)