Skip to content

Commit 0e7bc70

Browse files
authored
[PM-7447] Publish prerelease to GitHub packages (#716)
We have a desire to publish every build of the wasm to gh package for faster use in the clients repository.
1 parent 9c7a1a0 commit 0e7bc70

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/build-wasm.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2929
with:
3030
node-version: 18
31+
registry-url: "https://npm.pkg.github.com"
3132
cache: "npm"
3233

3334
- name: Install dependencies
@@ -56,3 +57,20 @@ jobs:
5657
name: sdk-bitwarden-wasm
5758
path: ${{ github.workspace }}/languages/js/wasm/*
5859
if-no-files-found: error
60+
61+
- name: Set version
62+
if: ${{ github.ref == 'refs/head/main' }}
63+
# Fetches current version from registry and uses prerelease to bump it
64+
run: |
65+
npm version --no-git-tag-version $(npm view @bitwarden/sdk-wasm@latest version)
66+
npm version --no-git-tag-version prerelease
67+
env:
68+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
working-directory: languages/js/wasm
70+
71+
- name: Publish NPM
72+
if: ${{ github.ref == 'refs/head/main' }}
73+
run: npm publish --access public
74+
env:
75+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
working-directory: languages/js/wasm

0 commit comments

Comments
 (0)