Skip to content

Commit

Permalink
feat: release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Netail committed Jan 29, 2025
1 parent 3ca6dbb commit 184aa41
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
continue-on-error: false
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Node setup
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
token: ${{ secrets.GITHUB_TOKEN }}
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Config
id: config
run: |
echo "VERSION=$(npm pkg get version)" >> $GITHUB_OUTPUT
- name: Install packages
run: yarn install

- name: Build
run: yarn build

- name: Publish
run: npm publish --access public

- name: Publish GitHub release
uses: elgohr/Github-Release-Action@v5
with:
title: "v${{ steps.config.outputs.VERSION }}"
tag: "v${{ steps.config.outputs.VERSION }}"

0 comments on commit 184aa41

Please sign in to comment.