forked from ioquake/ioq3
-
Notifications
You must be signed in to change notification settings - Fork 18
85 lines (74 loc) · 2.04 KB
/
main.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
name: Build
on:
push:
branches:
- '*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
env:
OS: Linux
- os: ubuntu-latest
env:
PLATFORM: mingw32
DEFAULT_HOMEDIR: .
OS: Windows
- os: macos-latest
env:
OS: macOS
env:
MAKEFLAGS: -j4
steps:
- uses: actions/checkout@v3
- name: setup
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update; sudo apt install -yy mingw-w64 libgl1-mesa-dev libsdl2-dev libfreetype6-dev libxxf86vm-dev
- name: build
run: |
make all
make all ARCHIVE=1 -j1
cd build
version=$(git show -s --pretty=format:%ad-%h --date=short)
for file in *.zip; do
bname=$(basename "$file" .zip)
bname=${bname/mingw32-/windows}
bname=${bname/darwin-universal/macOS}
bname=${bname/linux-/linux}
bname=${bname/x86_64/64}
bname=${bname/x86/32}
mv "$file" "ioq3urt-m9-${bname}-${version}.zip"
done
env: ${{ matrix.env }}
- uses: actions/upload-artifact@v3
with:
name: build-${{github.run_number}}-${{ matrix.env.OS }}.zip
path: build/*.zip
upload:
needs: build
if: github.ref == 'refs/heads/urt'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: rickstaa/action-create-tag@v1
with:
tag: builds/${{github.run_number}}
force_push_tag: true
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
with:
path: build
- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: build/*/*.zip
tag_name: builds/${{github.run_number}}
overwrite: true
draft: false