Skip to content

Commit

Permalink
[PM-7447] Publish prerelease to GitHub packages (#716)
Browse files Browse the repository at this point in the history
We have a desire to publish every build of the wasm to gh package for
faster use in the clients repository.
  • Loading branch information
Hinton authored Apr 16, 2024
1 parent 9c7a1a0 commit 0e7bc70
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 18
registry-url: "https://npm.pkg.github.com"
cache: "npm"

- name: Install dependencies
Expand Down Expand Up @@ -56,3 +57,20 @@ jobs:
name: sdk-bitwarden-wasm
path: ${{ github.workspace }}/languages/js/wasm/*
if-no-files-found: error

- name: Set version
if: ${{ github.ref == 'refs/head/main' }}
# Fetches current version from registry and uses prerelease to bump it
run: |
npm version --no-git-tag-version $(npm view @bitwarden/sdk-wasm@latest version)
npm version --no-git-tag-version prerelease
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: languages/js/wasm

- name: Publish NPM
if: ${{ github.ref == 'refs/head/main' }}
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: languages/js/wasm

0 comments on commit 0e7bc70

Please sign in to comment.