-
-
Notifications
You must be signed in to change notification settings - Fork 0
222 lines (187 loc) · 7.14 KB
/
pre-release.yaml
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: Build Executables
on:
workflow_dispatch:
inputs:
release_version:
description: 'Release Version'
required: true
default: ''
type: string
permissions: write-all
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PyInstaller
run: pip install pyinstaller
- name: Update Metadata
run: |
python tools/gh_actions.py metadata VERSION ${{ github.event.inputs.release_version }}
python tools/gh_actions.py metadata PRE_RELEASE true
- name: Build executable for Linux
run: |
pyinstaller --onefile --add-data "helpers/*:helpers" commitify.py
- name: Move Linux executable
run: |
mv dist/commitify ./commitify-linux
- name: Upload Linux artifact
uses: actions/upload-artifact@v4 # Use v4
with:
name: linux-executable
path: commitify-linux # Ensure this matches the moved file's name
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Install PyInstaller
run: pip install pyinstaller
- name: Update Metadata
run: |
python tools/gh_actions.py metadata VERSION ${{ github.event.inputs.release_version }}
python tools/gh_actions.py metadata PRE_RELEASE true
- name: Build executable for Windows
run: |
pyinstaller --onefile --add-data "helpers/*:helpers" commitify.py
- name: Move Windows executable
run: |
move dist\commitify.exe commitify.exe # Just rename to commitify.exe
- name: Upload Windows artifact
uses: actions/upload-artifact@v4 # Use v4
with:
name: windows-executable
path: commitify.exe # Ensure this matches the moved file's name
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PyInstaller
run: pip install pyinstaller
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Update Metadata
run: |
python tools/gh_actions.py metadata VERSION ${{ github.event.inputs.release_version }}
python tools/gh_actions.py metadata PRE_RELEASE true
- name: Build executable for macOS
run: |
pyinstaller --onefile --add-data "helpers/*:helpers" commitify.py
- name: Move macOS executable
run: |
mv dist/commitify ./commitify-darwin
- name: Upload macOS artifact
uses: actions/upload-artifact@v4 # Use v4
with:
name: macos-executable
path: commitify-darwin # Ensure this matches the moved file's name
release:
needs: [build-linux, build-windows, build-macos]
runs-on: ubuntu-latest # This can be any OS since we are just uploading artifacts.
steps:
- name: Checkout code for release job
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history to access tags
- name: Get Latest Tag
id: get_latest_tag
run: |
echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v5
with:
mode: "COMMIT" # Use commit-based mode
fromTag: ${{ env.LATEST_TAG }} # Use the latest tag found in the previous step
toTag: main # Compare to the main branch
configurationJson: |
{
"categories": [
{
"title": "## Features",
"labels": [
"feat",
"✨ feat:",
"📈 feat:",
"🚀 deploy:",
"👽️ feat:",
"🚸 feat:",
"🏗️ refactor:",
"♿️ feat:",
"🌱 feat:",
"➕ feat:",
"➖ fix:",
"💫 feat:",
"💸 chore:",
"👔 feat:",
"🩺 feat:",
"🥚 feat:"
]
},
{
"title": "## Fixes",
"labels": [
"fix",
"🐛 fix:",
"🩹 fix:",
"🚨 fix:",
"⚰️ fix:",
"\uD83D\uDC9A ci:"
]
},
{ "title": "## Performance Improvements", "labels": ["⚡️ perf:" ] },
{ "title": "## Documentation", "labels": ["docs", "📝 docs:" ] },
{ "title": "## Style Changes", "labels": ["style", "🎨 style:" ] },
{ "title": "## Critical Fixes", "labels": ["🚑️ fix:", "🔥 fix:" ] },
{ "title": "## Breaking Changes", "labels": ["BREAKING CHANGE", "💥 BREAKING CHANGE:" ] },
{ "title": "## Other Changes", "labels": [] }
],
"ignore_labels": [],
"empty_template": "- No changes",
"commit_template": "- `{{SHA}}`: {{message}} ({{author}})"
}
token: ${{ secrets.GITHUB_TOKEN }}
# Download artifacts from previous jobs.
- name: Download Linux artifact
uses: actions/download-artifact@v4 # Use v4 to download artifacts.
with:
name: linux-executable
- name: Download Windows artifact
uses: actions/download-artifact@v4 # Use v4 to download artifacts.
with:
name: windows-executable
- name: Download macOS artifact
uses: actions/download-artifact@v4 # Use v4 to download artifacts.
with:
name: macos-executable
# List downloaded files for debugging purposes.
- name: List downloaded files before release upload
run: ls -al
- name: Create Pre-Release Assets using softprops/action-gh-release
uses: softprops/action-gh-release@v1
with:
tag_name: "pre-${{ github.event.inputs.release_version }}" # Use input for tag_name.
name: "pre-${{ github.event.inputs.release_version }}"
body: ${{ steps.build_changelog.outputs.changelog }} # Use the generated changelog as release notes
prerelease: true
files: commitify-linux, commitify.exe, commitify-darwin, commitify.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use the GitHub token for authentication