From 45c4e30d067c83d5c97fada9c39e8fa4b6bf56e9 Mon Sep 17 00:00:00 2001 From: Agustincito Date: Mon, 30 Dec 2024 11:12:35 -0300 Subject: [PATCH] Add prerelease and release workflows --- .github/workflows/prerelease.yml | 34 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 10 ++++------ 2 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/prerelease.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 0000000..6d865c7 --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,34 @@ +name: Pre release NPM package +on: + release: + types: [prereleased] + +jobs: + prereleased: + name: Pre released + + permissions: + contents: write + pull-requests: write + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: 'main' + + - uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: 'pnpm' + node-version-file: '.nvmrc' + + - name: Install Dependencies + run: pnpm install --frozen-lockfile + + - name: Changeset PR + uses: changesets/action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d115d0..e757503 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: Publish Package to npmjs on: release: - types: [published] + types: [released] jobs: release: @@ -23,10 +23,8 @@ jobs: - name: Install Dependencies run: pnpm install --frozen-lockfile - - name: Publish to npm - uses: changesets/action@v1 - with: - publish: pnpm publish + + - run: npm publish --provenance --access public + name: Publish to npm env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}