-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.74 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Publish
on:
workflow_dispatch:
inputs:
version:
description: Release type
required: false
type: choice
default: patch
options:
- patch
- minor
- major
release:
types: [created]
jobs:
build:
uses: ./.github/workflows/build.yml
version:
needs: build
runs-on: ubuntu-latest
name: Update version in package.json
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- name: Show version
run: cat ./package.json | grep version
- name: Bump version
id: version
uses: KageKirin/[email protected]
with:
major: ${{ github.event.inputs.version == 'major' }}
minor: ${{ github.event.inputs.version == 'minor' }}
patch: ${{ github.event.inputs.version == 'patch' }}
- name: Show updated version
run: cat ./package.json | grep version
- name: Commit new version
run: |
echo ${{ toJson(steps.version) }}
# publish-npm:
# needs: version
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 20
# registry-url: https://registry.npmjs.org/
# - run: npm ci
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}