Skip to content

Commit

Permalink
ci: add snapshot release
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Mar 17, 2024
1 parent b9b3a8d commit 45d5126
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion .github/workflows/release.yml
Expand Up @@ -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:
Expand Down Expand Up @@ -54,3 +56,35 @@ 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
if:
run: npm --no-git-tag-version version ${npm_package_version}-snapshot-${GIT_COMMIT}

- name: Bump snapshot version
if:
run: npm publish --tag snapshot
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 45d5126

Please sign in to comment.