v0.6.10 #5
Workflow file for this run
This file contains hidden or 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: Npm Publish | |
on: | |
release: | |
types: [created] | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.release.target_commitish }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "22" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies | |
run: npm ci | |
- name: Extract version from release | |
id: extract_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
- name: Update version.ts | |
run: | | |
echo "export const VERSION = \"$VERSION\";" > common/version.ts | |
- name: Update package.json version | |
run: npm version $VERSION --no-git-tag-version | |
- name: Build | |
run: npm run build | |
- name: Commit changes | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add common/version.ts package.json | |
git commit -m "chore: update version to $VERSION [skip ci]" | |
git push | |
- name: Publish to npm | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |