|
1 | | -name: Build and Test |
| 1 | +name: Test and Release |
2 | 2 | on: [push] |
3 | 3 |
|
4 | 4 | jobs: |
5 | | - download-libclang-dll: |
| 5 | + linux-x86_64: |
6 | 6 | runs-on: ubuntu-24.04 |
7 | | - name: 'Download and Extract libclang.dll' |
8 | 7 |
|
9 | 8 | steps: |
10 | | - - name: Cache libclang.dll |
11 | | - id: cache-libclang |
12 | | - uses: actions/cache@v5 |
| 9 | + - uses: actions/checkout@v6 |
13 | 10 | 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 |
18 | 14 | 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 |
30 | 19 | 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 |
34 | 45 | overwrite: true |
35 | 46 | compression-level: 0 |
36 | | - retention-days: 1 |
37 | 47 |
|
38 | 48 |
|
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 |
52 | 51 |
|
53 | 52 | steps: |
54 | | - - uses: actions/checkout@v4 |
| 53 | + - uses: actions/checkout@v6 |
55 | 54 | with: |
56 | 55 | 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 |
60 | 61 | - 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 |
63 | 63 | with: |
64 | 64 | packages: libclang-18-dev libllvm18 libsdl2-dev libsdl2-image-dev |
65 | 65 | version: 1 |
66 | 66 | - name: Setup libclang and llvm symlinks |
67 | | - if: env.os == 'linux' |
68 | 67 | 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 |
70 | 69 | 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 |
74 | 85 | 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 |
78 | 91 |
|
79 | | - - name: Install llvm, sdl2, sdl2_image |
80 | | - run: brew install llvm@19 sdl2 sdl2_image |
81 | | - if: env.os == 'macos' |
82 | 92 |
|
| 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 |
83 | 102 | - uses: laytan/setup-odin@v2 |
84 | 103 | with: |
85 | 104 | token: ${{ secrets.GITHUB_TOKEN }} |
86 | 105 | 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 |
92 | 110 | 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/' |
97 | 116 |
|
98 | | - - name: examples (olived, tiled) |
99 | | - run: just example olivec example tiled |
100 | 117 |
|
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 |
102 | 125 | 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 |
114 | 128 | with: |
115 | 129 | path: windows_installer.iss |
116 | | - - name: Rename runic artifact |
117 | | - run: mv build/runic build/runic.${{ env.plat }} |
118 | | - if: env.os == 'macos' |
119 | 130 |
|
120 | | - - uses: actions/upload-artifact@v4 |
121 | | - if: env.os == 'macos' |
| 131 | + - uses: actions/upload-artifact@v7 |
122 | 132 | 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/* |
125 | 135 | if-no-files-found: warn |
126 | 136 | overwrite: true |
127 | 137 | 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 |
130 | 145 | 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 |
138 | 149 | 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/* |
141 | 172 | if-no-files-found: warn |
142 | 173 | overwrite: true |
143 | 174 | compression-level: 0 |
144 | 175 |
|
| 176 | + |
| 177 | + |
145 | 178 | create-release: |
146 | 179 | runs-on: ubuntu-24.04 |
147 | | - needs: build-and-test |
| 180 | + needs: [ linux-x86_64, linux-arm64, windows-x86_64, macos-arm64 ] |
148 | 181 | if: startsWith(github.ref, 'refs/tags/') |
149 | 182 | permissions: |
150 | 183 | contents: write |
| 184 | + |
151 | 185 | steps: |
152 | | - - uses: actions/download-artifact@v4 |
| 186 | + - uses: actions/download-artifact@v8 |
153 | 187 | with: |
154 | 188 | pattern: 'runic*' |
155 | 189 | merge-multiple: true |
156 | 190 | path: artifacts |
157 | | - - name: List all artifacts |
158 | | - run: ls -la --color=always artifacts |
| 191 | + - uses: list |
| 192 | + run: ls -lah --color=always artifacts |
159 | 193 | - uses: ncipollo/release-action@v1 |
160 | 194 | with: |
161 | 195 | artifacts: 'artifacts/*' |
|
0 commit comments