-
Notifications
You must be signed in to change notification settings - Fork 29
71 lines (61 loc) · 1.92 KB
/
bump-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
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
name: Bump version
on:
workflow_dispatch:
inputs:
arguments:
description: 'standard-release arguments'
required: false
default: ''
jobs:
bump-version:
name: Bump version
runs-on: ubuntu-latest
steps:
- name: Ensure develop branch
if: github.ref != 'refs/heads/develop'
run: |-
echo "Not running on develop - exit"
exit 1
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: ⚙️ Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'
cache: 'npm'
- name: 🧰 Install
run: npm ci
- name: ⬆️ Bump package version
run: |-
git config --global user.email "[email protected]"
git config --global user.name "Release Bot"
npm run release -- ${{ github.event.inputs.arguments }}
- name: 📝 Set Version
run: |-
APP_VERSION="v$(node -pe "require('./package.json').version")"
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
branch: bump/${{ env.APP_VERSION }}
base: develop
delete-branch: true
title: ':arrow_up: Bump to ${{ env.APP_VERSION }}'
body: |
Bump to version: ${{ env.APP_VERSION }}
labels: |
automated pr
- name: Checkout to PR branch
uses: actions/checkout@v2
with:
ref: bump/${{ env.APP_VERSION }}
# We purposely not push the tag
# The tag will be added when develop is merged into main
- run: git push
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"