Manual Release and Publish #20
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: Manual Release and Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
release: | |
name: Manual Release and Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Get version from package.json | |
id: get_version | |
run: echo "VERSION=$(node -p 'require("./package.json").version')" >> $GITHUB_ENV | |
- name: Create a Release | |
uses: elgohr/Github-Release-Action@v5 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
title: v${{ env.VERSION }} | |
tag: v${{ env.VERSION }} | |
workdir: "./dist" | |
- run: pnpm publish --access public | |
working-directory: "./dist" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |