Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v5

- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: 24
node-version: "24"
cache: pnpm

- run: pnpm install --frozen-lockfile
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

permissions:
contents: write
id-token: write

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Check version change
id: version
run: |
CURRENT=$(jq -r .version package.json)
echo "version=$CURRENT" >> "$GITHUB_OUTPUT"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
PREVIOUS=$(git show HEAD~1:package.json | jq -r .version)
if [ "$CURRENT" = "$PREVIOUS" ]; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- if: steps.version.outputs.changed == 'true'
uses: pnpm/action-setup@v5
- if: steps.version.outputs.changed == 'true'
uses: actions/setup-node@v6
with:
node-version: "24"
cache: pnpm
registry-url: "https://registry.npmjs.org"
- if: steps.version.outputs.changed == 'true'
run: pnpm install --frozen-lockfile
- if: steps.version.outputs.changed == 'true'
run: pnpm build
- if: steps.version.outputs.changed == 'true'
run: pnpm publish --no-git-checks --access public
- name: Create release tag
if: steps.version.outputs.changed == 'true'
env:
TAG: v${{ steps.version.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
],
"type": "module",
"publishConfig": {
"registry": "https://npm.pkg.github.com"
"access": "public",
"registry": "https://registry.npmjs.org"
},
"scripts": {
"build": "vite build",
Expand Down