Skip to content

chore: release and publish from github actions #850

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

Merged
merged 6 commits into from
Aug 9, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI
on:
pull_request:
push:
branches:
- main
- "8.0" # remove this after 8.0 is merged into main

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

- name: Setup pnpm
uses: pnpm/action-setup@v4

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

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm run lint

- name: Typecheck
run: pnpm run typecheck && pnpm run dev:typecheck

- name: Build
run: pnpm run build

- name: Publint
run: pnpm run publint
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
tags:
- "v**"

permissions:
id-token: write
contents: write

jobs:
release:
runs-on: ubuntu-latest
environment: npm-publish

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

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

- name: Install Dependencies
run: pnpm install

- name: Extract release notes
run: pnpm releaselog --format=notes ${{ github.ref_name }} > RELEASE_NOTES.md

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: RELEASE_NOTES.md
prerelease: ${{ contains(github.ref_name, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: pnpm run build

- name: Publish to npm
run: npm i -g npm && pnpm publish --access public --tag latest --no-git-checks
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"author": "GU Yiling <[email protected]>",
"scripts": {
"dev": "vite",
"build": "pnpm run docs && tsdown",
"build": "tsdown",
"typecheck": "tsc",
"lint": "eslint . --fix",
"format": "prettier . --write",
Expand All @@ -19,7 +19,7 @@
"dev:preview": "vite preview",
"dev:typecheck": "vue-tsc -p ./demo",
"docs": "jiti ./scripts/docs.ts",
"prepublishOnly": "pnpm run typecheck && pnpm run dev:typecheck && pnpm run build && publint"
"release": "pnpm run docs && bumpp -a"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump version and trigger release ci via pnpm run release

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bumpp makes it rather easy to bump the version and create a new tag. I’ve used it in other projects, but often ended up creating tags with the wrong content.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can still use bumpp for version bumping and tagging, but I’d prefer to trigger the release manually.

},
"packageManager": "[email protected]",
"type": "module",
Expand Down Expand Up @@ -48,6 +48,7 @@
"@vue/eslint-config-typescript": "^14.6.0",
"@vue/tsconfig": "^0.7.0",
"@vueuse/core": "^13.6.0",
"bumpp": "^10.2.2",
"comment-mark": "^2.0.1",
"echarts": "^6.0.0",
"echarts-gl": "^2.0.9",
Expand All @@ -61,6 +62,7 @@
"postcss-nested": "^7.0.2",
"prettier": "^3.6.2",
"publint": "^0.3.12",
"releaselog": "^6.0.3",
"tsdown": "^0.13.3",
"typescript": "^5.9.2",
"unplugin-raw": "^0.5.1",
Expand Down
Loading