-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
83 lines (77 loc) · 2.17 KB
/
action.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Node version bumper
description: Bump version for node package
branding:
icon: arrow-up-circle
color: green
inputs:
node-version:
description: The version of node to use.
type: string
default: 20.x
required: false
npm-registry:
description: NPM registry
type: string
default: https://registry.npmjs.org/
required: false
working-directory:
description: package repository
type: string
default: '.'
required: false
is-workspace:
description: indicate if the package is a workspace
type: boolean
default: false
required: false
version:
type: string
required: true
preid:
type: string
default: ''
required: false
commiter-name:
type: string
default: Node Version Bumper
required: false
commiter-email:
type: string
default: <>
required: false
commit-message:
type: string
default: "ci(version): bump to v%s"
required: false
outputs:
version:
description: Outputed version
value: ${{ steps.bump-ver.outputs.version || steps.bump-pre.outputs.version }}
runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Bump Version
id: bump-ver
if: inputs.preid == ''
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
version=$(npm version ${{ inputs.version }} ${{ inputs.is-workspace == true && '-ws' || '' }} -m "${{ inputs.commit-message }}")
echo "version=$version" >> $GITHUB_OUTPUT
- name: Bump Pre Version
id: bump-per
if: inputs.preid != ''
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
version=$(npm version ${{ inputs.version }} --preid=${{ inputs.preid }} ${{ inputs.is-workspace == true && '-ws' || '' }} -m "${{ inputs.commit-message }}")
echo "version=$version" >> $GITHUB_OUTPUT
- name: Remove NPM tag
shell: bash
run: |
echo ${{ steps.bump-ver.outputs.version }}
echo ${{ steps.bump-pre.outputs.version }}
git tag -d ${{ steps.bump-ver.outputs.version || steps.bump-pre.outputs.version }}