generated from ony3000/node-library-template
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (36 loc) · 1.01 KB
/
auto-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Automated Release
on:
workflow_dispatch:
inputs:
releaseLevel:
description: 'Release Level'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v2
with:
run_install: true
- name: Build a bundle
run: pnpm run build
- name: Bump a package version as github-actions bot
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
npm version ${{ inputs.releaseLevel }} -m "chore: release %s"
git push && git push --tags
- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}