From f1c93bc37c1c6cdf77bb7116ddfb43ecc7c4d9e4 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:02:15 +0100 Subject: [PATCH] ci: add publish workflow --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ 1 file 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..767f81e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish + +on: + release: + types: [prereleased, released] + +jobs: + publish: + name: Publish to NPM + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + filter: tree:0 + + - name: Enable corepack + run: corepack enable pnpm + + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + cache: 'pnpm' + + - run: pnpm install + - run: git config --global user.name "${{ github.actor }}" + - run: git config --global user.email "github-action-${{ github.actor }}@users.noreply.github.com" + - run: npm version from-git --no-git-tag-version + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} \ No newline at end of file