|
5 | 5 | branches: [main] |
6 | 6 | push: |
7 | 7 | branches: [main] |
| 8 | + release: |
| 9 | + types: [published] |
8 | 10 |
|
9 | 11 | env: |
10 | 12 | ghc: "9.10.3" |
|
47 | 49 | artifact: gren_linux |
48 | 50 | - runner: ubuntu-24.04-arm |
49 | 51 | arch: aarch64 |
50 | | - artifact: gren_linux_arm64 |
| 52 | + artifact: gren_linux_aarch64 |
51 | 53 |
|
52 | 54 | runs-on: ${{ matrix.runner }} |
53 | 55 |
|
@@ -121,7 +123,11 @@ jobs: |
121 | 123 | needs: validate-code-formatting |
122 | 124 | strategy: |
123 | 125 | matrix: |
124 | | - os: [macos-15, macos-15-intel] |
| 126 | + include: |
| 127 | + - os: macos-15 |
| 128 | + artifact: gren_mac_aarch64 |
| 129 | + - os: macos-15-intel |
| 130 | + artifact: gren_mac |
125 | 131 |
|
126 | 132 | runs-on: ${{ matrix.os }} |
127 | 133 |
|
@@ -175,7 +181,7 @@ jobs: |
175 | 181 |
|
176 | 182 | - uses: actions/upload-artifact@v4 |
177 | 183 | with: |
178 | | - name: gren-${{ matrix.os }} |
| 184 | + name: ${{ matrix.artifact }} |
179 | 185 | path: gren |
180 | 186 | retention-days: 14 |
181 | 187 |
|
@@ -234,3 +240,35 @@ jobs: |
234 | 240 | name: gren.exe |
235 | 241 | path: gren |
236 | 242 | retention-days: 14 |
| 243 | + |
| 244 | + publish-release: |
| 245 | + needs: [linux, mac, windows] |
| 246 | + if: github.event_name == 'release' |
| 247 | + runs-on: ubuntu-latest |
| 248 | + permissions: |
| 249 | + contents: write |
| 250 | + |
| 251 | + steps: |
| 252 | + - name: Download all build artifacts |
| 253 | + uses: actions/download-artifact@v4 |
| 254 | + with: |
| 255 | + path: artifacts |
| 256 | + |
| 257 | + - name: Stage release assets |
| 258 | + run: | |
| 259 | + set -eux |
| 260 | + mkdir release-assets |
| 261 | + for name in gren_linux gren_linux_aarch64 gren_mac gren_mac_aarch64 gren.exe; do |
| 262 | + cp "artifacts/$name/gren" "release-assets/$name" |
| 263 | + done |
| 264 | +
|
| 265 | + - name: Upload assets to release |
| 266 | + env: |
| 267 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 268 | + GH_REPO: ${{ github.repository }} |
| 269 | + TAG: ${{ github.event.release.tag_name }} |
| 270 | + run: | |
| 271 | + cd release-assets |
| 272 | + gh release upload "$TAG" \ |
| 273 | + gren_linux gren_linux_aarch64 gren_mac gren_mac_aarch64 gren.exe \ |
| 274 | + --clobber |
0 commit comments