-
Notifications
You must be signed in to change notification settings - Fork 9
106 lines (83 loc) · 3.36 KB
/
build.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
name: Build
on: [push]
jobs:
windows:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: source/msvc/Star Ruler 2/Star Ruler 2.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Non-Steam Release
name: Windows build
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: "msbuild /m \"/p:Configuration=${{env.BUILD_CONFIGURATION}}\" \"${{env.SOLUTION_FILE_PATH}}\""
- name: Pack ZIP artifact
run: "Compress-Archive -Path bin,credits.txt,\"Star Ruler 2.exe\",COPYING,sr2.ico -DestinationPath binaries-windows.zip"
shell: powershell
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-windows.zip
path: binaries-windows.zip
linux:
name: Linux build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt update && sudo apt install cmake libpng-dev libglew-dev libogg-dev libfreetype6-dev libcurl4-openssl-dev libxrandr-dev libopenal-dev libvorbis-dev xorg-dev
- name: Build
run: make -j$(nproc) compile
- name: Pack ZIP artifact
run: zip binaries-linux.zip bin bin/lin64 bin/lin64/StarRuler2.bin credits.txt StarRuler2.sh COPYING sr2.png
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-linux.zip
path: binaries-linux.zip
deploy:
name: Deployment
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/master'
needs:
- windows
- linux
steps:
- uses: actions/checkout@v4
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: binaries-windows.zip
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: binaries-linux.zip
- name: Update nightly Git tag
run: git tag -f nightly && git push --force origin nightly
- name: Update Windows nightly release
uses: WebFreak001/deploy-nightly@v3.1.0
with:
upload_url: https://uploads.github.com/repos/OpenSRProject/OpenStarRuler/releases/35747870/assets{?name,label}
release_id: 35747870
asset_path: ./binaries-windows.zip
asset_name: OpenStarRuler-binaries-windows-nightly-$$.zip
asset_content_type: application/zip # required by GitHub API
max_releases: 1
- name: Update Linux nightly release
uses: WebFreak001/deploy-nightly@v3.1.0
with:
upload_url: https://uploads.github.com/repos/OpenSRProject/OpenStarRuler/releases/35747870/assets{?name,label}
release_id: 35747870
asset_path: ./binaries-linux.zip
asset_name: OpenStarRuler-binaries-linux-nightly-$$.zip
asset_content_type: application/zip # required by GitHub API
max_releases: 1