-
Notifications
You must be signed in to change notification settings - Fork 1
150 lines (124 loc) · 5.45 KB
/
build_linux.yml
File metadata and controls
150 lines (124 loc) · 5.45 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
name: Build latest (Linux)
# trigger via either push to selected branches or on manual run
on:
push:
branches:
- main
- master
- ModernLighting
- AngledLighting
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-linux
cancel-in-progress: true
jobs:
#============================================
# =============== 32 BIT LINUX ==============
# ===========================================
build-32:
timeout-minutes: 10
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
steps:
- uses: actions/checkout@v4
- name: Install packages
shell: bash
run: |
apt-get -y update
apt-get -y install gcc-multilib wget curl unzip
- name: Retrieve dependencies
shell: bash
run: |
wget https://github.com/ClassiCube/rpi-compiling-stuff/raw/main/linux32.zip
unzip linux32.zip
- name: Compile 32 bit Linux builds
shell: bash
id: compile
env:
LIBS: "-lX11 -lXi -lpthread -lGL -lm -ldl"
SRCS: "src/*.c third_party/bearssl/*.c"
FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -fvisibility=hidden -rdynamic -Werror"
NIX32_FLAGS: "-no-pie -fno-pie -m32 -fcf-protection=none -L ./lib -Wl,--unresolved-symbols=ignore-in-shared-libs"
run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"${GITHUB_SHA::9}\"
gcc ${{ env.SRCS }} ${{ env.FLAGS }} ${{ env.NIX32_FLAGS }} $LATEST_FLAG -o cc-nix32-gl1 ${{ env.LIBS }}
gcc ${{ env.SRCS }} ${{ env.FLAGS }} ${{ env.NIX32_FLAGS }} $LATEST_FLAG -DCC_GFX_BACKEND=CC_GFX_BACKEND_GL2 -o cc-nix32-gl2 ${{ env.LIBS }}
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-nix32-gl1'
DEST_NAME: 'ClassiCube-Linux32-OpenGL'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-nix32-gl2'
DEST_NAME: 'ClassiCube-Linux32-ModernGL'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
NOTIFY_MESSAGE: 'Successfully compiled 32 bit ClassiCube Linux builds.'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/notify_failure
if: failure()
with:
NOTIFY_MESSAGE: 'Failed to produce 32 bit Linux build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
#============================================
# =============== 64 BIT LINUX ==============
# ===========================================
build-64:
timeout-minutes: 10
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
steps:
- uses: actions/checkout@v4
- name: Install packages
shell: bash
run: |
apt-get -y update
apt-get -y install gcc wget curl unzip
- name: Retrieve dependencies
shell: bash
run: |
wget https://github.com/ClassiCube/rpi-compiling-stuff/raw/main/linux64.zip
unzip linux64.zip
- name: Compile 64 bit Linux builds
shell: bash
id: compile
env:
LIBS: "-lX11 -lXi -lpthread -lGL -lm -ldl"
SRCS: "src/*.c third_party/bearssl/*.c"
FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -fvisibility=hidden -rdynamic -Werror"
NIX64_FLAGS: "-no-pie -fno-pie -m64 -fcf-protection=none -rdynamic -L ./lib -Wl,--unresolved-symbols=ignore-in-shared-libs"
run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"${GITHUB_SHA::9}\"
gcc ${{ env.SRCS }} ${{ env.FLAGS }} ${{ env.NIX64_FLAGS }} $LATEST_FLAG -o cc-nix64-gl1 ${{ env.LIBS }}
gcc ${{ env.SRCS }} ${{ env.FLAGS }} ${{ env.NIX64_FLAGS }} $LATEST_FLAG -DCC_GFX_BACKEND=CC_GFX_BACKEND_GL2 -o cc-nix64-gl2 ${{ env.LIBS }}
#gcc ${{ env.SRCS }} ${{ env.FLAGS }} ${{ env.NIX64_FLAGS }} $LATEST_FLAG -DCC_GFX_BACKEND=CC_GFX_BACKEND_GL2 -DCC_WIN_BACKEND=CC_WIN_BACKEND_SDL2 -o cc-sdl64-gl2 -lSDL2 ${{ env.LIBS }}
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-nix64-gl1'
DEST_NAME: 'ClassiCube-Linux64-OpenGL'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-nix64-gl2'
DEST_NAME: 'ClassiCube-Linux64-ModernGL'
# - uses: ./.github/actions/upload_build
# if: ${{ always() && steps.compile.outcome == 'success' }}
# with:
# SOURCE_FILE: 'cc-sdl64-gl2'
# DEST_NAME: 'ClassiCube-Linux64-SDL2'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
NOTIFY_MESSAGE: 'Successfully compiled 64 bit ClassiCube Linux builds.'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/notify_failure
if: failure()
with:
NOTIFY_MESSAGE: 'Failed to produce 64 bit Linux build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'