Skip to content

Commit

Permalink
ci: release workflow (#1834)
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianMazur committed Nov 6, 2024
1 parent c180fb5 commit 32d4fd4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
release:
types: [created]

jobs:
npm:
name: NPM
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Determine NPM tag
id: npm-tag
run: |
version="${{ github.ref_name }}"
major_version=$(echo "$version" | cut -d. -f1)
if [ "$major_version" = "13" ]; then
echo "tag=legacy" >> $GITHUB_ENV
else
echo "tag=latest" >> $GITHUB_ENV
fi
- name: Publish to NPM
run: npm publish --tag ${{ env.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 32d4fd4

Please sign in to comment.