From: Ardis Lu Date: Wed, 4 Jun 2025 06:24:27 +0000 (-0700) Subject: Release and publish on new version tags X-Git-Tag: v0.1.1~1 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=00994272ea75f4c98abc70deb6466a49bfe1f230;p=csvio Release and publish on new version tags --- diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e36f4e1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: Release + +on: + push: + tags: + - "v*.*.*" + workflow_call: + secrets: + NPM_TOKEN: + required: true + +jobs: + release: + name: Release on GitHub + runs-on: ubuntu-24.04 + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - id: "generate-body" + run: | + { + echo 'BODY<> "$GITHUB_OUTPUT" + - run: echo ${{ steps.generate-body.outputs.BODY }} + - uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.generate-body.outputs.BODY }} + + publish: + name: Publish to npm + runs-on: ubuntu-24.04 + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/setup-node@v4 + with: + node-version-file: ".node-version" + registry-url: "https://registry.npmjs.org" + - run: npm ci + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}