Skip to content

Commit

Permalink
Adding the release workflow
Browse files Browse the repository at this point in the history
	new file:   .github/workflows/release.yml
  • Loading branch information
abernatskiy committed Sep 9, 2024
1 parent 703bb9f commit 6071a50
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release
on:
workflow_dispatch:
inputs:
tag:
type: choice
description: Tag
required: true
options:
- beta
- latest
- alpha

jobs:
build-publish:
name: Build & publish
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Write npm credentials
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> .npmrc
npm whoami
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Release
run: npm publish --tag ${{ github.event.inputs.tag }} --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 comments on commit 6071a50

Please sign in to comment.