Skip to content

Commit 39d60ab

Browse files
committed
Rewrite CI push workflow
1 parent ead3f8b commit 39d60ab

1 file changed

Lines changed: 134 additions & 100 deletions

File tree

‎.github/workflows/push.yml‎

Lines changed: 134 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,161 +1,195 @@
1-
name: Build and Test
1+
name: Test and Release
22
on: [push]
33

44
jobs:
5-
download-libclang-dll:
5+
linux-x86_64:
66
runs-on: ubuntu-24.04
7-
name: 'Download and Extract libclang.dll'
87

98
steps:
10-
- name: Cache libclang.dll
11-
id: cache-libclang
12-
uses: actions/cache@v5
9+
- uses: actions/checkout@v6
1310
with:
14-
key: 'libclang.dll@v19.1.7'
15-
path: ${{ github.workspace }}/build/libclang.dll
16-
- uses: actions/checkout@v4
17-
if: steps.cache-libclang.outputs.cache-hit != 'true'
11+
submodules: recursive
12+
- uses: extractions/setup-just@v4
13+
- uses: laytan/setup-odin@v2
1814
with:
19-
repository: PucklaJ/odin-libclang
20-
ref: '19.1.7'
21-
- uses: extractions/setup-just@v3
22-
if: steps.cache-libclang.outputs.cache-hit != 'true'
23-
name: Install just
24-
- name: Download libclang.dll
25-
if: steps.cache-libclang.outputs.cache-hit != 'true'
26-
run: just download-library '' 'build/'
27-
shell: bash
28-
- name: Upload libclang.dll
29-
uses: actions/upload-artifact@v4
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
release: dev-2026-05
17+
- name: Install libclang, llvm, sdl2, sdl2_image
18+
uses: awalsh128/cache-apt-pks-action@v1
3019
with:
31-
name: libclang.dll
32-
path: ${{ github.workspace }}/build/libclang.dll
33-
if-no-files-found: error
20+
packages: libclang-18-dev libllvm18 libsdl2-dev libsdl2-image-dev
21+
version: 1
22+
- name: Setup libclang and llvm symlinks
23+
run: |
24+
sudo ln -rfs /usr/lib/x86_64-linux-gnu/libclang-18.so /usr/lib/x86_64-linux-gnu/libclang.so
25+
sudo ln -rfs /usr/lib/llvm-18/lib/libLLVM.so.1 /usr/lib/libLLVM-18.so.18.1
26+
27+
- name: test
28+
run: just test
29+
30+
- name: examples (olivec, tiled)
31+
run: just example olivec example tiled
32+
33+
- name: build appimage
34+
run: |
35+
mkdir appimagetool_bin/
36+
just install-appimagetool appimagetool_bin
37+
export PATH=$(realpath appimagetool_bin):$PATH
38+
just package
39+
40+
- uses: actions/upload-artifact@v7
41+
with:
42+
name: runic-linux-x86_64
43+
path: ${{ github.workspace }}/build/pacakge/*
44+
if-no-files-found: warn
3445
overwrite: true
3546
compression-level: 0
36-
retention-days: 1
3747

3848

39-
build-and-test:
40-
runs-on: ${{ matrix.os }}
41-
needs: download-libclang-dll
42-
strategy:
43-
fail-fast: false
44-
matrix:
45-
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2022, macos-14]
46-
name: ${{ matrix.os == 'ubuntu-24.04' && 'linux-x86_64' || matrix.os == 'ubuntu-24.04-arm' && 'linux-aarch64' || matrix.os == 'macos-13' && 'macos-x86_64' || matrix.os == 'macos-14' && 'macos-aarch64' || 'windows-x86_64' }}
47-
env:
48-
os: ${{ startsWith(matrix.os, 'ubuntu') && 'linux' || startsWith(matrix.os, 'macos') && 'macos' || 'windows' }}
49-
arch: ${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64' || matrix.os == 'macos-14' && 'aarch64' || 'x86_64' }}
50-
plat: ${{ matrix.os == 'ubuntu-24.04' && 'linux-x86_64' || matrix.os == 'ubuntu-24.04-arm' && 'linux-aarch64' || matrix.os == 'macos-13' && 'macos-x86_64' || matrix.os == 'macos-14' && 'macos-aarch64' || 'windows-x86_64' }}
51-
49+
linux-arm64:
50+
runs-on: ubuntu-24.04-arm
5251

5352
steps:
54-
- uses: actions/checkout@v4
53+
- uses: actions/checkout@v6
5554
with:
5655
submodules: recursive
57-
- uses: extractions/setup-just@v3
58-
name: Install just
59-
56+
- uses: extractions/setup-just@v4
57+
- uses: laytan/setup-odin@v2
58+
with:
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
release: dev-2026-05
6061
- name: Install libclang, llvm, sdl2, sdl2_image
61-
if: env.os == 'linux'
62-
uses: awalsh128/cache-apt-pkgs-action@v1
62+
uses: awalsh128/cache-apt-pks-action@v1
6363
with:
6464
packages: libclang-18-dev libllvm18 libsdl2-dev libsdl2-image-dev
6565
version: 1
6666
- name: Setup libclang and llvm symlinks
67-
if: env.os == 'linux'
6867
run: |
69-
sudo ln -rfs /usr/lib/${{ env.arch }}-linux-gnu/libclang-18.so /usr/lib/${{ env.arch }}-linux-gnu/libclang.so
68+
sudo ln -rfs /usr/lib/aarch64-linux-gnu/libclang-18.so /usr/lib/aarch64-linux-gnu/libclang.so
7069
sudo ln -rfs /usr/lib/llvm-18/lib/libLLVM.so.1 /usr/lib/libLLVM-18.so.18.1
71-
- name: Download libclang.dll
72-
if: env.os == 'windows'
73-
uses: actions/download-artifact@v4
70+
71+
- name: test
72+
run: just test
73+
74+
- name: examples (olivec, tiled)
75+
run: just example olivec example tiled
76+
77+
- name: build appimage
78+
run: |
79+
mkdir appimagetool_bin/
80+
just install-appimagetool appimagetool_bin
81+
export PATH=$(realpath appimagetool_bin):$PATH
82+
just package
83+
84+
- uses: actions/upload-artifact@v7
7485
with:
75-
name: libclang.dll
76-
merge-multiple: true
77-
path: build
86+
name: runic-linux-aarch64
87+
path: ${{ github.workspace }}/build/pacakge/*
88+
if-no-files-found: warn
89+
overwrite: true
90+
compression-level: 0
7891

79-
- name: Install llvm, sdl2, sdl2_image
80-
run: brew install llvm@19 sdl2 sdl2_image
81-
if: env.os == 'macos'
8292

93+
windows-x86_64:
94+
runs-on: windows-2025
95+
96+
steps:
97+
- uses: actions/checkout@v6
98+
with:
99+
submodules: recursive
100+
- uses: ilammy/msvc-dev-cmd@v1
101+
- uses: extractions/setup-just@v4
83102
- uses: laytan/setup-odin@v2
84103
with:
85104
token: ${{ secrets.GITHUB_TOKEN }}
86105
release: dev-2026-05
87-
- uses: ilammy/msvc-dev-cmd@v1
88-
if: env.os == 'windows'
89-
90-
- name: Test
91-
uses: nick-fields/retry@v3
106+
107+
- name: cache libclang.dll
108+
id: cache-libclang
109+
uses: actions/cache@v5
92110
with:
93-
command: just test
94-
timeout_minutes: 2
95-
retry_wait_seconds: 1
96-
max_attempts: 1
111+
key: 'libclang.dll@v19.1.7'
112+
path: ${{ github.workspace }}/build/libclang.dll
113+
- name: download libclang.dll
114+
if: steps.cache-libclang.outputs.cache-hit != 'true'
115+
run: just -f shared/libclang/justfile download-library '' 'build/'
97116

98-
- name: examples (olived, tiled)
99-
run: just example olivec example tiled
100117

101-
- name: Build runic release
118+
- name: test
119+
run: just test
120+
121+
- name: examples (olivec, tiled)
122+
run: just example olivec example tiled
123+
124+
- name: build runic
102125
run: just
103-
if: env.os == 'windows' || env.os == 'macos'
104-
- name: Build runic AppImage
105-
run: |
106-
mkdir appimagetool_bin/
107-
just install-appimagetool appimagetool_bin/
108-
export PATH=$(pwd)/appimagetool_bin/:$PATH
109-
just package
110-
if: env.os == 'linux'
111-
- name: Build runic installer
112-
uses: Minionguyjpro/Inno-Setup-Action@v1.2.5
113-
if: env.os == 'windows'
126+
- name: build runic installer
127+
uses: Minionguyjpro/Inno-Setup-Action@v1.2.8
114128
with:
115129
path: windows_installer.iss
116-
- name: Rename runic artifact
117-
run: mv build/runic build/runic.${{ env.plat }}
118-
if: env.os == 'macos'
119130

120-
- uses: actions/upload-artifact@v4
121-
if: env.os == 'macos'
131+
- uses: actions/upload-artifact@v7
122132
with:
123-
name: runic-${{ env.plat }}
124-
path: ${{ github.workspace }}/build/runic.${{ env.plat }}
133+
name: runic-windows-x86_64
134+
path: ${{ github.workspace }}/build/pacakge/*
125135
if-no-files-found: warn
126136
overwrite: true
127137
compression-level: 0
128-
- uses: actions/upload-artifact@v4
129-
if: env.os == 'linux'
138+
139+
140+
macos-arm64:
141+
runs-on: macos-14
142+
143+
steps:
144+
- uses: actions/checkout@v6
130145
with:
131-
name: runic-${{ env.plat }}
132-
path: ${{ github.workspace }}/build/package/*
133-
if-no-files-found: warn
134-
overwrite: true
135-
compression-level: 0
136-
- uses: actions/upload-artifact@v4
137-
if: env.os == 'windows'
146+
submodules: recursive
147+
- uses: extractions/setup-just@v4
148+
- uses: laytan/setup-odin@v2
138149
with:
139-
name: runic-${{ env.plat }}
140-
path: ${{ github.workspace }}/build/package/*
150+
token: ${{ secrets.GITHUB_TOKEN }}
151+
release: dev-2026-05
152+
- name: install llvm, sdl2, sdl2_image
153+
run: brew install llvm@19 sdl2 sdl2_image
154+
155+
- name: test
156+
run: just test
157+
158+
- name: examples (olivec, tiled)
159+
run: just example olivec example tiled
160+
161+
- name: build runic
162+
run: just
163+
- name: create runic artifact
164+
run: |
165+
mkdir build/package
166+
mv build/runic build/package/runic-macos-aarch64
167+
168+
- uses: actions/upload-artifact@v7
169+
with:
170+
name: runic-macos-aarch64
171+
path: ${{ github.workspace }}/build/pacakge/*
141172
if-no-files-found: warn
142173
overwrite: true
143174
compression-level: 0
144175

176+
177+
145178
create-release:
146179
runs-on: ubuntu-24.04
147-
needs: build-and-test
180+
needs: [ linux-x86_64, linux-arm64, windows-x86_64, macos-arm64 ]
148181
if: startsWith(github.ref, 'refs/tags/')
149182
permissions:
150183
contents: write
184+
151185
steps:
152-
- uses: actions/download-artifact@v4
186+
- uses: actions/download-artifact@v8
153187
with:
154188
pattern: 'runic*'
155189
merge-multiple: true
156190
path: artifacts
157-
- name: List all artifacts
158-
run: ls -la --color=always artifacts
191+
- uses: list
192+
run: ls -lah --color=always artifacts
159193
- uses: ncipollo/release-action@v1
160194
with:
161195
artifacts: 'artifacts/*'

0 commit comments

Comments
 (0)