Publish package #37
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 package | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'yarn' | |
- run: yarn install --immutable | |
- run: yarn build | |
- run: yarn test:ci | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Build packages | |
run: yarn run build | |
- name: Bundle library | |
run: yarn run bundle | |
- name: Get current package version | |
id: package_version | |
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT | |
- name: Publish to NPM | |
run: yarn run publish --tag latest | |
env: | |
YARN_NPM_AUTH_TOKEN: ${{secrets.npm_token}} | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
repository: KILTProtocol/docs | |
event-type: sdk-update | |
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}' |