-
-
Notifications
You must be signed in to change notification settings - Fork 9
67 lines (57 loc) · 1.74 KB
/
create-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
66
67
name: Official release
on:
workflow_dispatch: # Manually on demand
inputs:
versionBump:
description: 'Type of version bump'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
publish-config:
runs-on: ubuntu-20.04
strategy:
matrix:
node: [20.x] # This should be LTS
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch the history, or this action won't work
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Test
run: npm test
- name: Prepare release
env:
VERSION_BUMP: ${{ inputs.versionBump }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
npm run release -- ${VERSION_BUMP}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PR_TOKEN }}
commit-message: "[OFFICIAL RELEASE] ${{ steps.version.outputs.result }}"
committer: foxriver76 <[email protected]>
author: foxriver76 <[email protected]>
signoff: false
branch: official-release
delete-branch: true
title: "[OFFICIAL RELEASE] ${{ steps.version.outputs.result }}"
body: |
Update version by release action
labels: |
automated pr 🔧
assignees: foxriver76
draft: false