-
Notifications
You must be signed in to change notification settings - Fork 80
197 lines (172 loc) · 5.57 KB
/
build-all.yaml
File metadata and controls
197 lines (172 loc) · 5.57 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
196
197
---
name: build-all
on:
workflow_dispatch:
push:
jobs:
build-linux:
runs-on: ubuntu-22.04
strategy:
matrix:
flavour: [pkg-appimage-snapshot, pkg-appimage-deployment, pkg-appimage]
steps:
## This is for debugging only and helps developing the workflow.
# - name: Environment Variables
# run: |
# printenv | sort
- name: Update Ubuntu
run: |
sudo apt-get update
sudo apt-get install -y git
- name: Checkout Oolite
uses: actions/checkout@v6
with:
path: oolite
fetch-depth: 0
submodules: true
- name: Checkout dependencies
run: |
oolite/ShellScripts/Linux/checkout_deps.sh
- name: Install packages
run: |
sudo oolite/ShellScripts/Linux/install_deps_root.sh
- name: Build Oolite
run: |
oolite/ShellScripts/common/build_oolite.sh ${{matrix.flavour}}
- name: Archive installer
uses: actions/upload-artifact@v6
with:
name: oolite-linux-${{matrix.flavour}}
path: |
oolite/build/Oolite_*.AppImage
retention-days: 5
build-flatpak:
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-25.08
options: --privileged
steps:
- name: Checkout Oolite
uses: actions/checkout@v6
with:
path: oolite
fetch-depth: 0
submodules: true
- name: Build flatpak
run: |
oolite/installers/flatpak/create_flatpak.sh
- name: Archive installer
uses: actions/upload-artifact@v6
with:
name: oolite-flatpak
path: |
oolite/build/space.oolite.Oolite*.flatpak
retention-days: 5
build-windows:
runs-on: windows-latest
strategy:
matrix:
flavour: [pkg-win-snapshot, pkg-win-deployment, pkg-win]
steps:
## This is for debugging only and helps developing the workflow.
# - name: Environment Variables
# run: |
# Get-ChildItem Env: | Sort Name
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
update: true
- name: Checkout Oolite
uses: actions/checkout@v6
with:
path: oolite
fetch-depth: 0
submodules: true
- name: Download latest release assets
uses: robinraju/release-downloader@v1
with:
repository: OoliteProject/oolite_windeps_build
latest: true
fileName: "*"
out-file-path: oolite/build/packages
- name: Install packages
shell: msys2 {0}
env:
msystem: UCRT64
run: |
oolite/ShellScripts/Windows/install_deps.sh clang
- name: Build Oolite
shell: msys2 {0}
env:
msystem: UCRT64
run: |
oolite/ShellScripts/common/build_oolite.sh ${{matrix.flavour}}
- name: Archive installer
uses: actions/upload-artifact@v6
with:
name: oolite-windows-${{matrix.flavour}}
path: |
oolite/build/OoliteInstall*.exe
retention-days: 5
release:
needs: [build-linux, build-flatpak, build-windows]
runs-on: ubuntu-22.04
steps:
## This is for debugging only and helps developing the workflow.
# - name: Environment Variables
# run: |
# printenv | sort
- name: Download artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
- name: Checkout Oolite
uses: actions/checkout@v6
with:
path: oolite
fetch-depth: 0
- name: Calculate version number and set OOLITE_VERSION
id: version
run: |
set -x
cd oolite
# Build version string,
# taking into account that we may have just two digits
source ShellScripts/common/get_version.sh
cat build/OOLITE_VERSION.txt >> "$GITHUB_OUTPUT"
- name: Remove old prereleases
if: github.ref == 'refs/heads/master'
uses: s00d/delete-older-releases@0.2.1
with:
keep_latest: 7
delete_type: 'prerelease'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# For changes on master branch, create a new release.
# It should move the 'latest' tag automatically.
- name: Create Release
if: github.ref == 'refs/heads/master'
id: create_release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
# automatic_release_tag: "latest"
automatic_release_tag: "${{ steps.version.outputs.OOLITE_VERSION }}"
prerelease: true
title: "Oolite ${{ steps.version.outputs.OOLITE_VERSION }}"
files: |
artifacts/oolite-windows-pkg-win-snapshot/OoliteInstall-*-dev.exe
artifacts/oolite-windows-pkg-win-deployment/OoliteInstall-*.exe
artifacts/oolite-windows-pkg-win/OoliteInstall-*.exe
artifacts/oolite-linux-pkg-appimage-snapshot/*.AppImage
artifacts/oolite-linux-pkg-appimage-deployment/*.AppImage
artifacts/oolite-linux-pkg-appimage/*.AppImage
artifacts/oolite-flatpak/*.flatpak
- name: Remove old workflow runs
if: github.ref == 'refs/heads/master'
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 30
keep_minimum_runs: 8