-
Notifications
You must be signed in to change notification settings - Fork 58
217 lines (207 loc) · 7.97 KB
/
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
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
#
# This script will tag the repo, compile and zip Einstein, and publish it
# as a GitHub Release.
#
name: 'Deploy Einstein on GitHub'
# This job must be called explicitly form the 'Actions' tab in GitHub
on:
workflow_dispatch:
inputs:
# The Version Tag is extracted from CMakeLists.txt
#version_tag:
# description: 'Release Version Tag'
# required: true
# default: '2024.4.21'
build-macos-universal-fltk:
type: boolean
description: Build macOS Universal FLTK
default: 'true'
build-linux-x64-fltk:
type: boolean
description: Build Linux x64 FLTK
default: 'true'
build-windows-x64-fltk:
type: boolean
description: Build Windows x64 FLTK
default: 'true'
build-windows-arm64-fltk:
type: boolean
description: Build Windows arm64 FLTK
default: 'true'
build-macos-universal-cocoa:
type: boolean
description: Build macOS Universal Cocoa
default: 'true'
# build-android
# build-iOS
# Windows cmake build option for arm64 is -A ARM64
# On Linux, we will have to do additional installs and set a bunch of environment variables
jobs:
# Build the MacOS FLTK version as a Universal Binary for x64 and ARM64
build-macos-universal-fltk:
runs-on: macos-latest
if: ${{ github.event.inputs.build-macos-universal-fltk == 'true' }}
steps:
- name: Get Einstein Sources
uses: actions/checkout@v4
- name: Get Release Version Tag
run: |
export RELEASE_TAG="v"`grep -o '"Einstein" VERSION "[^"]*' CMakeLists.txt | grep -o '[^"]*$'`
echo "RELEASE_TAG=$RELEASE_TAG"
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Compile Einstein
run: |
cmake -S . -B build \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
-D "CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
cmake --build build --target Einstein
- name: Pack Einstein
run: |
mv build/Einstein.app .
cmake -E tar cf Einstein_macOS_universal_fltk_${{env.RELEASE_TAG}}.zip --format=zip Einstein.app
- name: Publish Einstein
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: 'true'
artifacts: Einstein_macOS_universal_fltk_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
build-linux-x64-fltk:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.build-linux-x64-fltk == 'true' }}
steps:
- name: Get dependencies
run: |
sudo apt-get install -y libpulse-dev ninja-build libbsd-dev
wget --no-check-certificate -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
sudo apt-get update
sudo apt-get install clang-format-13
- name: Get sources
uses: actions/checkout@v4
- name: Get Version
run: |
export RELEASE_TAG="v"`grep -o '"Einstein" VERSION "[^"]*' CMakeLists.txt | grep -o '[^"]*$'`
echo "RELEASE_TAG=$RELEASE_TAG"
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Compile Einstein
run: |
cmake -S . -B build \
-D CMAKE_BUILD_TYPE=Release
cmake --build build --target Einstein
- name: Pack Einstein
run: |
mv build/Einstein .
cmake -E tar cf Einstein_linux_x64_fltk_${{env.RELEASE_TAG}}.zip --format=zip Einstein
- name: Publish Einstein
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: 'true'
artifacts: Einstein_linux_x64_fltk_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
build-windows-x64-fltk:
runs-on: windows-latest
if: ${{ github.event.inputs.build-windows-x64-fltk == 'true' }}
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Get Version
shell: pwsh
run: |
# Select-String -Path CMakeLists.txt -CaseSensitive -Pattern '"Einstein" VERSION'
$env:RELEASE_TAG2=(Select-String -Path CMakeLists.txt -CaseSensitive -Pattern '"Einstein" VERSION')
# gci env:RELEASE_TAG2
$env:RELEASE_TAG=($env:RELEASE_TAG2 -replace '.* VERSION "', '' -replace '".*\)', '')
# gci env:RELEASE_TAG
echo "RELEASE_TAG=v$env:RELEASE_TAG"
echo "RELEASE_TAG=v$env:RELEASE_TAG" >> $env:GITHUB_ENV
- name: Compile Einstein
run: |
cmake -S . -B build -A x64 -D CMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target Einstein
- name: Pack Einstein
run: |
mv build/Release/Einstein.exe .
cmake -E tar cf Einstein_windows_x64_fltk_${{env.RELEASE_TAG}}.zip --format=zip Einstein.exe
- uses: ncipollo/release-action@v1
with:
allowUpdates: 'true'
artifacts: Einstein_windows_x64_fltk_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
build-windows-arm64-fltk:
runs-on: windows-latest
if: ${{ github.event.inputs.build-windows-arm64-fltk == 'true' }}
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Get Version
shell: pwsh
run: |
# Select-String -Path CMakeLists.txt -CaseSensitive -Pattern '"Einstein" VERSION'
$env:RELEASE_TAG2=(Select-String -Path CMakeLists.txt -CaseSensitive -Pattern '"Einstein" VERSION')
# gci env:RELEASE_TAG2
$env:RELEASE_TAG=($env:RELEASE_TAG2 -replace '.* VERSION "', '' -replace '".*\)', '')
# gci env:RELEASE_TAG
echo "RELEASE_TAG=v$env:RELEASE_TAG"
echo "RELEASE_TAG=v$env:RELEASE_TAG" >> $env:GITHUB_ENV
- name: Compile Einstein
run: |
cmake -S . -B build -A ARM64 -D CMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target Einstein
- name: Pack Einstein
run: |
mv build/Release/Einstein.exe .
cmake -E tar cf Einstein_windows_arm64_fltk_${{env.RELEASE_TAG}}.zip --format=zip Einstein.exe
- uses: ncipollo/release-action@v1
with:
allowUpdates: 'true'
artifacts: Einstein_windows_arm64_fltk_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
build-macos-universal-cocoa:
runs-on: macos-latest
if: ${{ github.event.inputs.build-macos-universal-cocoa == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Get Release Version Tag
run: |
export RELEASE_TAG="v"`grep -o '"Einstein" VERSION "[^"]*' CMakeLists.txt | grep -o '[^"]*$'`
echo "RELEASE_TAG=$RELEASE_TAG"
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Build
run: |
xcodebuild archive \
-project _Build_/Xcode/Einstein.xcodeproj \
-scheme Einstein -configuration Release \
-archivePath Einstein.xcarchive \
ONLY_ACTIVE_ARCH=NO
- name: Pack Einstein
run: |
mv Einstein.xcarchive/Products/Applications/Einstein.app .
cmake -E tar cf Einstein_macOS_universal_cocoa_${{env.RELEASE_TAG}}.zip --format=zip Einstein.app
- name: Publish Einstein
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: 'true'
artifacts: Einstein_macOS_universal_cocoa_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}