-
Notifications
You must be signed in to change notification settings - Fork 5
107 lines (88 loc) · 3.17 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
107
name: Builds simple window program
on:
pull_request:
branches:
- main
push:
branches:
- main
defaults:
run:
shell: bash -e {0}
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
build-linux:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Install zig 0.13
run: |
wget https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz
tar xf zig-linux-x86_64-0.13.0.tar.xz
echo "$GITHUB_WORKSPACE/zig-linux-x86_64-0.13.0" >> $GITHUB_PATH
- name: Check zig version
run: |
[ "$(zig version)" != "0.13.0" ] && exit 1 || exit 0
- name: Install SDL2 via package manager
run: |
sudo apt update
sudo apt install libsdl2-dev
- name: Clone example project
run: git clone https://github.com/pwbh/sdl-window-test.git
- name: Fetch modified pwbh/SDL package
run: |
cd sdl-window-test
echo https://github.com/pwbh/SDL/archive/refs/heads/$BRANCH_NAME.tar.gz
zig fetch --save https://github.com/pwbh/SDL/archive/refs/heads/$BRANCH_NAME.tar.gz
- name: Build
run: |
cd sdl-window-test
zig build
build-macos:
name: MacOS
runs-on: macos-latest
steps:
- name: Install zig 0.13
run: |
wget https://ziglang.org/download/0.13.0/zig-macos-aarch64-0.13.0.tar.xz
tar xf zig-macos-aarch64-0.13.0.tar.xz
echo "$GITHUB_WORKSPACE/zig-macos-aarch64-0.13.0" >> $GITHUB_PATH
- name: Check zig version
run: |
[ "$(zig version)" != "0.13.0" ] && exit 1 || exit 0
- name: Clone example project
run: git clone https://github.com/pwbh/sdl-window-test.git
- name: Fetch modified pwbh/SDL package
run: |
cd sdl-window-test
echo https://github.com/pwbh/SDL/archive/refs/heads/$BRANCH_NAME.tar.gz
zig fetch --save https://github.com/pwbh/SDL/archive/refs/heads/$BRANCH_NAME.tar.gz
- name: Build
run: |
cd sdl-window-test
zig build
build-windows:
name: Windows
runs-on: windows-latest
steps:
- name: Install Zig 0.13
run: |
curl -L -o zig-windows-x86_64-0.13.0.zip https://ziglang.org/download/0.13.0/zig-windows-x86_64-0.13.0.zip
unzip -qq zig-windows-x86_64-0.13.0.zip -d $GITHUB_WORKSPACE
echo "$GITHUB_WORKSPACE/zig-windows-x86_64-0.13.0" >> $GITHUB_PATH
- name: Check Zig version
run: |
echo $GITHUB_PATH
[ "$($GITHUB_WORKSPACE/zig-windows-x86_64-0.13.0/zig version)" != "0.13.0" ] && exit 1 || exit 0
- name: Clone example project
run: git clone https://github.com/pwbh/sdl-window-test.git
- name: Fetch modified pwbh/SDL package
run: |
cd sdl-window-test
echo https://github.com/pwbh/SDL/archive/refs/heads/$BRANCH_NAME.tar.gz
$GITHUB_WORKSPACE/zig-windows-x86_64-0.13.0/zig fetch --save https://github.com/pwbh/SDL/archive/refs/heads/$BRANCH_NAME.tar.gz
- name: Build
run: |
cd sdl-window-test
$GITHUB_WORKSPACE/zig-windows-x86_64-0.13.0/zig build