-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.12 KB
/
bump.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
name: Bump
on:
workflow_call:
inputs:
mode:
required: true
type: string
outputs:
version:
value: ${{ jobs.bump.outputs.version }}
mode:
value: ${{ inputs.mode }}
jobs:
bump:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: git config
run: |
git config --local user.name "GitHub Action"
git config --local user.email "action@github.com"
- name: major
if: ${{ inputs.mode == 'major' }}
run: |
npm version major
- name: minor
if: ${{ inputs.mode == 'minor' }}
run: |
npm version minor
- name: patch
if: ${{ inputs.mode == 'patch' }}
run: |
npm version patch
- name: git push
run: |
git push origin
- id: version
run: |
VERSION=`cat package.json | jq -r '.version'`
echo "version=$VERSION" >> $GITHUB_OUTPUT