Skip to content

Build, Publish and Tag #3

Build, Publish and Tag

Build, Publish and Tag #3

name: Build, Publish and Tag
on:
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Publish
run: pnpm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
create-tag:
needs: build-and-publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Create Tag
run: |
VERSION=$(node -p "require('./package.json').version")
git tag v$VERSION
git push origin v$VERSION