-
Notifications
You must be signed in to change notification settings - Fork 80
37 lines (34 loc) · 1.23 KB
/
version.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
name: Version Bump
on:
schedule: [{ cron: '0 10 * * *' }] # daily: https://crontab.guru/#0_10_*_*_*
workflow_dispatch:
inputs:
version:
description: 'An explicit version (or major|minor|patch) to tag.'
default: ''
required: false
type: string
permissions: {contents: read}
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- if: ${{ !inputs.version }}
run: |-
npm run preversion --silent -- -o -v -- share/node-build || status=$?
case "${status:-0}" in
0) echo "bump=patch" >> $GITHUB_ENV;;
1) exit 0;; # exit successfully to mask error, but don't release
*) exit $status ;; # all other error codes are true failures
esac
- if: ${{ inputs.version || env.bump }}
run: npm version ${{ inputs.version || env.bump }}
env:
GIT_AUTHOR_NAME: ${{ vars.NODENV_BOT_NAME }}
GIT_AUTHOR_EMAIL: ${{ vars.NODENV_BOT_EMAIL }}
GIT_COMMITTER_NAME: ${{ vars.GHA_BOT_NAME }}
GIT_COMMITTER_EMAIL: ${{ vars.GHA_BOT_EMAIL }}