This repository has been archived by the owner on Feb 9, 2024. It is now read-only.
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: Release | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
publish: | |
name: Build & Publish to NPM | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Set up node | |
uses: actions/setup-node@v3 | |
with: | |
cache: pnpm | |
node-version: 18 | |
- name: Retrieve Version | |
if: startsWith(github.ref, 'refs/tags/') | |
id: get_tag_version | |
run: echo "tag_version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Build NPM Package | |
run: pnpm build | |
- run: npm pack | |
working-directory: "./packages/useink" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: package | |
path: "./packages/useink/*.tgz" | |
- uses: octokit/[email protected] | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
route: POST /repos/paritytech/npm_publish_automation/actions/workflows/publish.yml/dispatches | |
ref: main | |
inputs: '${{ format(''{{ "repo": "{0}", "run_id": "{1}" }}'', github.repository, github.run_id) }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} |