11name : Release
2+
23on :
34 # Trigger the workflow on the new 'v*' tag created
45 push :
@@ -20,84 +21,92 @@ jobs:
2021 name : Release ${{ github.ref_name }}
2122 draft : true
2223
23- # build-on-centos:
24- # runs-on: ubuntu-latest
25- # steps:
26- # - name: Checkout repo
27- # uses: actions/checkout@v2
28-
29- # - name: Build Docker image
30- # run: docker build -t linux -f Dockerfile.linux .
31-
32- # - name: Create container
33- # run: docker create --name linuxcontainer linux
34-
35- # - name: Copy executable
36- # run: |
37- # for TOOL in genoStats pileupCaller vcf2eigenstrat; do
38- # docker cp linuxcontainer:/root/.local/bin/$TOOL $TOOL-linux
39- # done
40-
41- # - name: update-release
42- # run: |
43- # for TOOL in genoStats pileupCaller vcf2eigenstrat; do
44- # bash .github/workflows/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} owner=stschiff repo=sequenceTools tag=$(basename $GITHUB_REF) filename=$TOOL-linux
45- # done
46-
47- build :
24+ build_normal_artifacts :
4825 needs : [create_release]
49- name : ${{ matrix.os }}/${{ github.ref_name }}
26+ name : ${{ matrix.os }}/${{ github.ref }}
5027 runs-on : ${{ matrix.os }}
51- continue-on-error : true
5228 strategy :
53- fail-fast : false
5429 matrix :
55- os : [macos-latest, ubuntu-20.04,windows-latest]
56-
30+ os : [ubuntu-20.04, macOS-13, macOS-14, windows-latest]
31+
5732 steps :
58-
59- - name : Checkout repo
60- uses : actions/checkout@v2
61-
62- - name : Setup Haskell
63- uses : haskell-actions/setup@v2
64- with :
65- ghc-version : " 9.4.7"
66- enable-stack : true
67- stack-version : " latest"
68-
69- - name : Build
70- run : stack install --system-ghc
71-
72- - name : Rename binaries (not windows)
73- if : ${{ matrix.os != 'windows-latest' }}
74- run : for TOOL in genoStats pileupCaller vcf2eigenstrat; do mv ~/.local/bin/$TOOL ~/.local/bin/$TOOL-$RUNNER_OS; done
75-
76- - name : Rename binaries (windows)
77- if : ${{ matrix.os == 'windows-latest' }}
78- # stack on windows installs into <Home>\AppData\Roaming\local\bin
79- # the default shell on Windows is powershell, so we use that
80- run : |
81- foreach ($tool in "genoStats", "pileupCaller", "vcf2eigenstrat") { Rename-Item "$env:USERPROFILE\AppData\Roaming\local\bin\$tool.exe" "$tool-windows.exe" }
82-
83- - name : Upload Release Asset (not windows)
84- uses : ncipollo/release-action@v1
85- if : ${{ matrix.os != 'windows-latest' }}
86- with :
87- name : Release ${{ github.ref_name }}
88- draft : true
89- allowUpdates : true
90- artifactErrorsFailBuild : true
91- artifacts : " ~/.local/bin/*"
92- artifactContentType : application/octet-stream
93-
94- - name : Upload Release Asset (windows)
95- uses : ncipollo/release-action@v1
96- if : ${{ matrix.os == 'windows-latest' }}
97- with :
98- name : Release ${{ github.ref_name }}
99- draft : true
100- allowUpdates : true
101- artifactErrorsFailBuild : true
102- artifacts : ' ~/AppData/Roaming/local/bin/*.exe'
103- artifactContentType : application/octet-stream
33+ - name : Check out code
34+ uses : actions/checkout@v4
35+
36+ - name : Set tag name
37+ uses : olegtarasov/get-tag@v2.1
38+ id : tagName
39+ with :
40+ tagRegex : " v(.*)"
41+ tagRegexGroup : 1
42+
43+ - name : Install stack on macOS, where it is not present (https://github.com/freckle/stack-action/issues/80)
44+ if : ${{ runner.os == 'macOS' }}
45+ run : curl -sSL https://get.haskellstack.org/ | sh
46+
47+ - name : Build executable
48+ uses : freckle/stack-action@v5
49+ id : stack
50+ with :
51+ test : false
52+ stack-build-arguments : --copy-bins --ghc-options="-O2"
53+
54+ - name : Set binary path name
55+ id : binarypath
56+ run : |
57+ if [ "$RUNNER_OS" == "Windows" ]; then
58+ newEXE="pileupCaller-$RUNNER_OS.exe"
59+ elif [ "$RUNNER_OS" == "macOS" ]; then
60+ newEXE="pileupCaller-$RUNNER_OS-$RUNNER_ARCH"
61+ else
62+ newEXE="pileupCaller-$RUNNER_OS"
63+ fi
64+ currentEXE="${{ steps.stack.outputs.local-bin }}/pileupCaller"
65+ mv $currentEXE $newEXE
66+ echo "BINARY_PATH=$newEXE" >> $GITHUB_OUTPUT
67+ shell : bash
68+
69+ - name : Compress binary
70+ if : ${{ runner.os != 'macOS' }} # upx is crashing for macOS Ventura or above!
71+ uses : svenstaro/upx-action@v2
72+ with :
73+ files : ${{ steps.binarypath.outputs.BINARY_PATH }}
74+
75+ - name : Upload Release Asset
76+ id : upload-release-asset
77+ uses : ncipollo/release-action@v1
78+ with :
79+ name : Release ${{ github.ref_name }}
80+ draft : true
81+ allowUpdates : true
82+ artifactErrorsFailBuild : true
83+ artifacts : ${{ steps.binarypath.outputs.BINARY_PATH }}
84+ artifactContentType : application/octet-stream
85+
86+ build_centos_artifact :
87+ needs : [create_release]
88+ runs-on : ubuntu-latest
89+
90+ steps :
91+ - name : Checkout repo
92+ uses : actions/checkout@v4
93+
94+ - name : Build Docker image
95+ run : docker build -t linux -f .github/workflows/Dockerfile.centos .
96+
97+ - name : Create container
98+ run : docker create --name linuxcontainer linux
99+
100+ - name : Copy executable
101+ run : docker cp linuxcontainer:/root/.local/bin/pileupCaller pileupCaller-conda-linux
102+
103+ - name : Upload Release Asset
104+ id : upload-release-asset
105+ uses : ncipollo/release-action@v1
106+ with :
107+ name : Release ${{ github.ref_name }}
108+ draft : true
109+ allowUpdates : true
110+ artifactErrorsFailBuild : true
111+ artifacts : pileupCaller-conda-linux
112+ artifactContentType : application/octet-stream
0 commit comments