From 4c88e867fb8bee60b6f3d6ca70aa73597351028b Mon Sep 17 00:00:00 2001 From: saltyaom Date: Mon, 30 Sep 2024 01:13:55 +0700 Subject: [PATCH] :tada: feat: provenance publish --- .github/workflows/publish.yml | 50 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) 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..f20844b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,50 @@ +name: Publish + +on: + release: + types: [published] + +defaults: + run: + shell: bash + +permissions: + id-token: write + +env: + # Enable debug logging for actions + ACTIONS_RUNNER_DEBUG: true + +jobs: + publish-npm: + name: 'Publish: npm Registry' + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + + - name: 'Setup Bun' + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + registry-url: "https://registry.npmjs.org" + + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + + - name: Install packages + run: bun install + + - name: Build code + run: bun run build + + - name: Test + run: bun run test + + - name: 'Publish' + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + npm publish --provenance --access=public diff --git a/package.json b/package.json index 094e115..c72bf73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@elysiajs/swagger", - "version": "1.1.2", + "version": "1.1.3", "description": "Plugin for Elysia to auto-generate Swagger page", "author": { "name": "saltyAom",