-
-
Notifications
You must be signed in to change notification settings - Fork 23
141 lines (117 loc) · 4.26 KB
/
Copy pathbuild.yml
File metadata and controls
141 lines (117 loc) · 4.26 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
name: Build and Release TLEscope
on:
push:
branches: [ "main", "master" ]
tags:
- 'v*' # Triggers stable release on version tags
pull_request:
branches: [ "main", "master" ]
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: Build and Install Raylib from Source
run: |
git clone --depth 1 https://github.com/raysan5/raylib.git
cd raylib/src
make PLATFORM=PLATFORM_DESKTOP
sudo make install
- name: Compile Linux Binaries
run: make linux
- name: Bundle Linux Release
run: |
mkdir -p TLEscope-Linux
cp bin/TLEscope TLEscope-Linux/
cp bin/fetch_tle TLEscope-Linux/
cp -r resources/ TLEscope-Linux/
cp settings.json TLEscope-Linux/
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: TLEscope-Linux
path: TLEscope-Linux/
retention-days: 14
build-windows:
name: Build Windows
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install MinGW (Windows Cross-Compiler)
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64 unzip
- name: Install Windows libcurl
run: |
wget -qO curl.zip "https://curl.se/windows/latest.cgi?p=win64-mingw.zip"
unzip -q curl.zip
# Move headers and libs into the cross-compiler's default search paths
sudo cp -r curl-*-win64-mingw/include/curl /usr/x86_64-w64-mingw32/include/
sudo cp -r curl-*-win64-mingw/lib/* /usr/x86_64-w64-mingw32/lib/
# Stage the required DLL so it gets bundled with the release
mkdir -p bin
cp curl-*-win64-mingw/bin/*.dll bin/
- name: Compile Windows Binaries
run: make windows
- name: Bundle Windows Release
run: |
mkdir -p TLEscope-Windows
cp bin/TLEscope.exe TLEscope-Windows/
# cp bin/fetch_tle.exe TLEscope-Windows/
cp bin/*.dll TLEscope-Windows/
cp -r resources/ TLEscope-Windows/
cp settings.json TLEscope-Windows/
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: TLEscope-Windows
path: TLEscope-Windows/
retention-days: 14
release:
name: Publish Release
needs: [build-linux, build-windows]
# Only run on pushes to main/master or tag pushes (ignore pull requests)
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: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Zip Artifacts for Release
run: |
cd artifacts
# make executable
chmod +x TLEscope-Linux/TLEscope
chmod +x TLEscope-Linux/fetch_tle
zip -r ../TLEscope-Linux.zip TLEscope-Linux/
zip -r ../TLEscope-Windows.zip TLEscope-Windows/
cd ..
- name: Update Nightly Release
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
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.zip
TLEscope-Windows.zip
- name: Publish Stable Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
TLEscope-Linux.zip
TLEscope-Windows.zip