forked from endless-sky/endless-sky
-
Notifications
You must be signed in to change notification settings - Fork 0
204 lines (194 loc) · 8.06 KB
/
cd.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
name: CD
on:
push:
branches:
- master
pull_request:
types:
- synchronize # New commit has been pushed
- opened
jobs:
cd_ubuntu_x86_64:
runs-on: ubuntu-latest
env:
OUTPUT: endless-sky-x86_64-continuous.tar.gz
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo rm /etc/apt/sources.list.d/* && sudo dpkg --clear-avail # Speed up installation and get rid of unwanted lists
sudo apt-get update
sudo apt-get install -y --no-install-recommends libsdl2-dev libpng-dev libjpeg-turbo8-dev libopenal-dev libmad0-dev libglew-dev libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev scons
- name: Adjust version strings
run: ./utils/cd_update_versions.sh
shell: bash
- name: Build Application
run: scons -j $(nproc)
- name: Package Application
run: tar -czf ${{ env.OUTPUT }} sounds images/ data/ license.txt keys.txt icon.png endless-sky credits.txt copyright changelog
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.OUTPUT }}
path: ${{ env.OUTPUT }}
cd_appimage_x86_64:
runs-on: ubuntu-16.04
env:
ARCH: x86_64
OUTPUT: endless-sky-x86_64-continuous.AppImage
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo rm /etc/apt/sources.list.d/* && sudo dpkg --clear-avail # Speed up installation and get rid of unwanted lists
sudo apt-get update
sudo apt-get install -y --no-install-recommends libsdl2-dev libpng-dev libjpeg-turbo8-dev libopenal-dev libmad0-dev libglew-dev libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev scons
- name: Adjust version strings
run: ./utils/cd_update_versions.sh
- name: Build AppImage
run: ./utils/build_appimage.sh
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.OUTPUT }}
path: ${{ env.OUTPUT }}
cd_windows_win64:
runs-on: windows-latest
env:
DIR_MINGW64: C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\x86_64-w64-mingw32
DIR_ESLIB: .\dev64
OUTPUT: EndlessSky-win64-continuous.zip
steps:
- uses: actions/checkout@v2
- name: Fetch development libraries
run: |
Invoke-WebRequest https://endless-sky.github.io/win64-dev.zip -OutFile win64-dev.zip
Expand-Archive win64-dev.zip -DestinationPath . -Force
Remove-Item win64-dev.zip
- name: Adjust version strings
run: ./utils/cd_update_versions.sh
shell: bash
- name: Build Application
run: |
make -e -f .winmake -j ($(Get-CIMInstance -Class 'CIM_Processor').NumberOfLogicalProcessors)
COPY .\bin\pkgd\EndlessSky.exe EndlessSky.exe
COPY ".\dev64\bin\*.dll" .
COPY C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\x86_64-w64-mingw32\lib\libgcc_s_seh-1.dll .
COPY C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\x86_64-w64-mingw32\lib\libstdc++-6.dll .
COPY C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\x86_64-w64-mingw32\lib\libwinpthread-1.dll .
- name: Package Application
run: 7z a ${{ env.OUTPUT }} .\sounds\ .\images\ .\data\ *.dll license.txt keys.txt icon.png EndlessSky.exe credits.txt copyright changelog
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.OUTPUT }}
path: ${{ env.OUTPUT }}
cd_macos_x86_64:
runs-on: macos-latest
env:
OUTPUT: EndlessSky-macOS10.15-continuous.zip
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
brew update
brew install libpng libjpeg-turbo libmad sdl2 p7zip
- name: Adjust library paths
run: |
install_name_tool -id "@rpath/libpng16.16.dylib" /usr/local/lib/libpng16.16.dylib
install_name_tool -id "@rpath/libmad.0.2.1.dylib" /usr/local/lib/libmad.0.2.1.dylib
install_name_tool -id "@rpath/libturbojpeg.0.dylib" /usr/local/opt/libjpeg-turbo/lib/libturbojpeg.0.dylib
install_name_tool -id "@rpath/libSDL2-2.0.0.dylib" /usr/local/lib/libSDL2-2.0.0.dylib
- name: Adjust version strings
run: ./utils/cd_update_versions.sh
shell: bash
- name: Build Application
run: xcodebuild -configuration "Release" -jobs $(sysctl -n hw.logicalcpu) -quiet
- name: Package Application
run: |
cd build/Release
7z a ${{ github.workspace }}/${{ env.OUTPUT }} Endless\ Sky.app
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.OUTPUT }}
path: ${{ env.OUTPUT }}
cd_upload_artifacts_to_release:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs:
- cd_ubuntu_x86_64
- cd_appimage_x86_64
- cd_windows_win64
- cd_macos_x86_64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT_UBUNTU: endless-sky-x86_64-continuous.tar.gz
OUTPUT_APPIMAGE: endless-sky-x86_64-continuous.AppImage
OUTPUT_WINDOWS: EndlessSky-win64-continuous.zip
OUTPUT_MACOS: EndlessSky-macOS10.15-continuous.zip
steps:
- uses: actions/checkout@v2
- name: Install github-release
run: |
go get github.com/github-release/github-release
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
- name: Set environment variables
run: |
echo ::set-env name=GITHUB_USER::$( echo ${{ github.repository }} | cut -d/ -f1 )
echo ::set-env name=GITHUB_REPO::$( echo ${{ github.repository }} | cut -d/ -f2 )
- name: Move/Create continuous tag
run: |
git tag --force continuous ${{ github.sha }}
git push --tags --force
- name: Setup continuous release
run: |
DESCRIPTION="Triggered on $(date -u '+%Y/%m/%d, %H:%M') UTC by commit ${{ github.sha }} (@${{ github.actor }})
This is an automated build of the latest source. It may be unstable or even crash, corrupt your save or eat your kitten. Use with caution!
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
if ! github-release info -t continuous > /dev/null 2>&1; then
github-release release \
--tag continuous \
--name "Continuous Build" \
--description "$DESCRIPTION" \
--pre-release
else
github-release edit \
--tag continuous \
--name "Continuous Build" \
--description "$DESCRIPTION" \
--pre-release
fi
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: ${{ github.workspace }} # This will download all files to e.g `./EndlessSky-win64.zip/EndlessSky-win64.zip`
- name: Add ${{ env.OUTPUT_UBUNTU }} to release tag
run: |
github-release upload \
--tag continuous \
--replace \
--name ${{ env.OUTPUT_UBUNTU }} \
--file ${{ env.OUTPUT_UBUNTU }}/${{ env.OUTPUT_UBUNTU }}
- name: Add ${{ env.OUTPUT_APPIMAGE }} to release tag
run: |
github-release upload \
--tag continuous \
--replace \
--name ${{ env.OUTPUT_APPIMAGE }} \
--file ${{ env.OUTPUT_APPIMAGE }}/${{ env.OUTPUT_APPIMAGE }}
- name: Add ${{ env.OUTPUT_WINDOWS }} to release tag
run: |
github-release upload \
--tag continuous \
--replace \
--name ${{ env.OUTPUT_WINDOWS }} \
--file ${{ env.OUTPUT_WINDOWS }}/${{ env.OUTPUT_WINDOWS }}
- name: Add ${{ env.OUTPUT_MACOS }} to release tag
run: |
github-release upload \
--tag continuous \
--replace \
--name ${{ env.OUTPUT_MACOS }} \
--file ${{ env.OUTPUT_MACOS }}/${{ env.OUTPUT_MACOS }}