-
Notifications
You must be signed in to change notification settings - Fork 8
123 lines (103 loc) · 3.66 KB
/
PreRelease.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Pre-Release
on:
workflow_dispatch:
inputs:
new-version:
description: 'New version to be set. (1.0.1)'
type: string
required: true
release-date:
description: 'Release date. (YYYY-MM-DD)'
type: string
required: true
new-dev-release:
description: 'Set the new dev version. (1.0.1)'
type: string
required: false
jobs:
run-lint-on-dev:
runs-on: ubuntu-latest
if: ${{ inputs.new-version }}
steps:
- name: Checkout into dev
uses: actions/checkout@v4
with:
ref: dev
token: ${{ secrets.PAT }}
- name: Install project dependencies
run: npm install
- name: Run build
run: npm run build
create-rc:
needs: run-lint-on-dev
runs-on: ubuntu-latest
if: ${{ inputs.new-version }}
steps:
- name: Checkout into dev
uses: actions/checkout@v4
with:
ref: dev
token: ${{ secrets.PAT }}
- name: Create branch rc${{ inputs.new-version }}
run: |
git checkout -b rc${{ inputs.new-version }}
git push -u origin rc${{ inputs.new-version }}
set-tag:
needs: create-rc
runs-on: ubuntu-latest
if: ${{ inputs.new-version }}
steps:
- name: Checkout into rc${{ inputs.new-version }}
uses: actions/checkout@v4
with:
ref: rc${{ inputs.new-version }}
fetch-depth: 0
token: ${{ secrets.PAT }}
- name: Set tag
run: |
git tag v${{ inputs.new-version }} HEAD
git push origin --tags
set-pre-release:
needs: set-tag
runs-on: ubuntu-latest
if: ${{ inputs.new-version }}
steps:
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2.0.5
with:
tag_name: v${{ inputs.new-version }}
name: Release of version ${{ inputs.new-version }} (${{ inputs.release-date }})
body: |
### What's New
- First
- ...
### Fixed Issues and Improvements
- First
- ...
draft: false
prerelease: true
token: ${{ secrets.PAT }}
update-dev-version:
needs: create-rc
runs-on: ubuntu-latest
if: ${{ inputs.new-version && inputs.new-dev-release }}
steps:
- name: Checkout into dev
uses: actions/checkout@v4
with:
ref: dev
token: ${{ secrets.PAT }}
- name: Install project dependencies
run: npm install
- name: Update dev version into v${{ inputs.new-dev-release }}
run: |
npm run gta-update-version --newVersion=${{ inputs.new-dev-release }}
- name: Sign and Commit version increment to branch dev
uses: ./.github/os-git-actions/signed-commit/
with:
branch: dev
message: 'Updated into v${{ inputs.new-dev-release }} [skip ci]'
newFiles: true
gpgPriv: ${{ secrets.GPG_SIGN_KEY }}
gpgPassPhrase: ${{ secrets.GPG_PASSPHRASE }}