Skip to content

Commit

Permalink
ci: enable auto publish
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Oct 17, 2024
1 parent e61e065 commit ee4638e
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Automatic Publish
on:
push:
branches:
- master
tags-ignore:
- '**'
paths-ignore:
- '**/*.md'
- LICENSE
- '**/*.gitignore'
- .editorconfig
- docs/**
pull_request: null
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- run: npm install -g npm
- run: pnpm install
- run: pnpm run build
- name: publish
run: |
if git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+$";
then
pnpm publish -r --provenance --access public
elif git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+";
then
pnpm publish -r --provenance --access public --tag next
else
echo "Not a release, skipping publish"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true

0 comments on commit ee4638e

Please sign in to comment.