Create GH Actions workflow to publish web-client to npm with provenance #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish web-client to npm | |
on: | |
push: | |
branches: | |
- soeren/web-client-package-provenance | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install Protoc | |
run: sudo apt-get install protobuf-compiler | |
- name: Build package | |
working-directory: ./web-client | |
run: ./scripts/build.sh | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm install -g npm | |
- name: Publish to npm | |
working-directory: ./web-client/dist | |
run: npm publish --tag next --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.SISOU_NPM_TOKEN }} |