Skip to content

Commit 8af8a8d

Browse files
committed
add a release builder script
1 parent 9d85960 commit 8af8a8d

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
name: build
3+
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build:
11+
name: build for ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
env:
14+
PROG_NAME: clusterpainter
15+
BIN_NAME: clusterpainter-${{ github.ref_name }}-${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os:
20+
- ubuntu-24.04
21+
- ubuntu-22.04
22+
- macos-15
23+
- macos-14
24+
- macos-13
25+
- windows-2025
26+
- windows-2022
27+
- windows-2019
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: haskell-actions/setup@v2
32+
with:
33+
ghc-version: '9.4'
34+
- run: |
35+
cabal build
36+
- name: build (unix)
37+
if: ${{ !contains(matrix.os, 'windows') }}
38+
run: |
39+
cp $( cabal list-bin ${{ env.PROG_NAME }} ) ${{ env.BIN_NAME }}
40+
xz -9 -k ${{ env.BIN_NAME }}
41+
- name: build (clippyos)
42+
if: ${{ contains(matrix.os, 'windows') }}
43+
run: |
44+
cp $( cabal list-bin ${{ env.PROG_NAME }} ) ${{ env.BIN_NAME }}.exe
45+
xz -9 -k ${{ env.BIN_NAME }}.exe
46+
- name: release (unix)
47+
if: ${{ !contains(matrix.os, 'windows') }}
48+
uses: softprops/action-gh-release@v2
49+
with:
50+
files: ${{ env.BIN_NAME }}.xz
51+
- name: release (clippyos)
52+
if: ${{ contains(matrix.os, 'windows') }}
53+
uses: softprops/action-gh-release@v2
54+
with:
55+
files: ${{ env.BIN_NAME }}.exe.xz

0 commit comments

Comments
 (0)