-
-
Notifications
You must be signed in to change notification settings - Fork 19
195 lines (172 loc) · 5.93 KB
/
build.yml
File metadata and controls
195 lines (172 loc) · 5.93 KB
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
name: Build and Release TLEscope
on:
push:
branches: [ "main", "master" ]
tags:
- 'v*'
paths-ignore:
- 'README.md'
- 'ROADMAP.md'
- 'CONTRIBUTING.md'
pull_request:
branches: [ "main", "master" ]
paths-ignore:
- 'README.md'
- 'ROADMAP.md'
- 'CONTRIBUTING.md'
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Linux Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc make libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev libcurl4-openssl-dev
- name: Compile and Bundle Linux
run: make linux
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: TLEscope-Linux-Portable
path: dist/TLEscope-Linux-Portable/
retention-days: 14
build-windows:
name: Build Windows
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup MSYS2 (MinGW Environment)
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
make
mingw-w64-x86_64-gcc
mingw-w64-x86_64-curl
mingw-w64-x86_64-ngtcp2
mingw-w64-x86_64-nghttp3
mingw-w64-x86_64-zstd
mingw-w64-x86_64-libssh2
mingw-w64-x86_64-openssl
mingw-w64-x86_64-pkgconf
mingw-w64-x86_64-nsis
mingw-w64-x86_64-imagemagick
- name: Compile and Bundle Windows
run: make win-installer MINGW_PREFIX=/mingw64 PKG_CONFIG_WIN=pkg-config
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: TLEscope-Win-Portable
path: dist/TLEscope-Win-Portable/
retention-days: 14
- name: Upload Windows Installer Artifact
uses: actions/upload-artifact@v4
with:
name: TLEscope-Installer
path: dist/TLEscope-Installer.exe
retention-days: 14
build-windows-arm64:
name: Build Windows ARM64
runs-on: windows-11-arm
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup MSYS2 (MinGW Environment)
uses: msys2/setup-msys2@v2
with:
msystem: CLANGARM64
update: true
install: >-
mingw-w64-clang-aarch64-make
mingw-w64-clang-aarch64-clang
mingw-w64-clang-aarch64-curl
mingw-w64-clang-aarch64-ngtcp2
mingw-w64-clang-aarch64-nghttp3
mingw-w64-clang-aarch64-zstd
mingw-w64-clang-aarch64-libssh2
mingw-w64-clang-aarch64-openssl
mingw-w64-clang-aarch64-pkgconf
- name: Compile and Bundle Windows ARM64
run: mingw32-make windows-arm64
- name: Upload Windows ARM64 Artifact
uses: actions/upload-artifact@v4
with:
name: TLEscope-Win-arm64-Portable
path: dist/TLEscope-Win-arm64-Portable/
retention-days: 14
release:
name: Publish Release
needs: [build-linux, build-windows, build-windows-arm64]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare and Zip Artifacts for Release
run: |
cd artifacts
# The Makefile bundles into subdirectories, so we zip those folders
chmod +x TLEscope-Linux-Portable/TLEscope
zip -r ../TLEscope-Linux-Portable.zip TLEscope-Linux-Portable/
zip -r ../TLEscope-Win-Portable.zip TLEscope-Win-Portable/
zip -r ../TLEscope-Win-arm64-Portable.zip TLEscope-Win-arm64-Portable/
# Move installer out of its artifact subdirectory for flat publishing
mv TLEscope-Installer/TLEscope-Installer.exe ../
cd ..
- name: Clean Existing Release Assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
gh release delete "${{ github.ref_name }}" -y || true
fi
- name: Force Update Nightly Tag
if: startsWith(github.ref, 'refs/heads/')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
gh release delete nightly --cleanup-tag -y || true
git tag -f nightly
git push -f origin nightly
- name: Update Nightly Release
if: startsWith(github.ref, 'refs/heads/')
uses: softprops/action-gh-release@v2
with:
tag_name: nightly
name: "Nightly Build"
body: "Automated nightly build reflecting the latest commit."
prerelease: true
files: |
TLEscope-Linux-Portable.zip
TLEscope-Win-Portable.zip
TLEscope-Win-arm64-Portable.zip
TLEscope-Installer.exe
- name: Publish Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
TLEscope-Linux-Portable.zip
TLEscope-Win-Portable.zip
TLEscope-Win-arm64-Portable.zip
TLEscope-Installer.exe