From 03f78b8bb02f2fa509ed1fa5418455e3d72888ad Mon Sep 17 00:00:00 2001 From: Yi-Cyuan Chen Date: Sat, 18 Jul 2026 18:14:15 +0800 Subject: [PATCH] Set up GitHub release action / provenance #46 --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..031e6b1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish + +on: + release: + types: [published] + +permissions: + contents: read + id-token: write + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 24.x + registry-url: https://registry.npmjs.org + package-manager-cache: false + + - run: npm ci + + - name: Verify release version + run: | + PACKAGE_VERSION=$(node -p "require('./package.json').version") + test "$GITHUB_REF_NAME" = "v$PACKAGE_VERSION" + + - run: npm run build + - run: npm test + - run: npm publish diff --git a/CHANGELOG.md b/CHANGELOG.md index 9346da2..5cf376a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## v0.12.0 / 2026-07-18 ### Added - support ESM #44 +- Set up GitHub release action / provenance #46 ### Fixed - Fix uploading coverage to coveralls #52