Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup release workflow #9

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: setup release workflow
  • Loading branch information
chenjiahan committed Sep 30, 2024
commit df6283be6761a607a5f99cd728a46440c3e63529
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This action will publish the package to npm and create a GitHub release.
name: Release

on:
# Run `npm run bump` to bump the version and create a git tag.
push:
tags:
- "v*"

workflow_dispatch:

permissions:
contents: write
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"

- name: Install Dependencies
run: pnpm install

- name: Publish
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: "true"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -21,7 +21,8 @@
"lint": "biome check .",
"lint:write": "biome check . --write",
"prepare": "simple-git-hooks && npm run build",
"test": "playwright test"
"test": "playwright test",
"bump": "npx bumpp"
},
"simple-git-hooks": {
"pre-commit": "npx nano-staged"