From 0cfb34053c9ca3b9ad9c60cc86a9275b357fc4dd Mon Sep 17 00:00:00 2001 From: Romain Billot Date: Tue, 29 Aug 2023 03:13:45 +0200 Subject: [PATCH] chore: auto publish package on release (#62) Co-authored-by: Romain --- .github/workflows/publish.yml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 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..22445cd --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,47 @@ +name: 🚀 Publish + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + packages: write + steps: + - name: ⬇️ Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 8 + run_install: false + + - name: Install Dependencies + run: pnpm install --frozen-lockfile --strict-peer-dependencies + + - name: Build + run: pnpm build + + - name: 📝 Version + env: + TAG_NAME: ${{ github.event.release.tag_name }} + run: pnpm version ${TAG_NAME} --no-git-tag-version + + - name: 🐙 Publish + env: + NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + run: | + pnpm publish --no-git-checks