Skip to content

Commit

Permalink
Merge pull request #4 from yudppp/feat-release-ci
Browse files Browse the repository at this point in the history
set release ci
  • Loading branch information
yudppp authored Jan 14, 2025
2 parents bf630a4 + 8b210a0 commit aa2446a
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release

on:
workflow_dispatch:
inputs:
version_type:
description: 'Bump version'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch

jobs:
release:
name: Create Release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js 22
uses: actions/setup-node@v3
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
- name: Bump version
id: bump-version
run: |
npm version ${{ github.event.inputs.version_type }}
echo "::set-output name=version::v$(node -p \"require('./package.json').version\")"
- name: Build library
run: npm run build

- name: Push changes
run: |
git push origin HEAD:main --follow-tags
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish

0 comments on commit aa2446a

Please sign in to comment.