diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 603fc7f..8fa62c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,13 +7,15 @@ on: type: choice description: Type of the release options: + - snapshot - patch - minor - major jobs: - build: + publish-release: runs-on: ubuntu-latest + if: ${{ github.event.inputs.release-type != 'snapshot' }} steps: - uses: actions/checkout@v4 with: @@ -54,3 +56,33 @@ jobs: run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + publish-snapshot: + runs-on: ubuntu-latest + if: ${{ github.event.inputs.release-type == 'snapshot' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v3 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + + - name: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Install + run: pnpm install + + - name: Build + run: pnpm build + + - name: Bump snapshot version + run: npm version --no-git-tag-version --preid=snapshot prepatch + + - name: Bump snapshot version + run: npm publish --tag snapshot + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}