updated gh-workflow #45
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
# Trigger the workflow on the new 'v*' tag created | |
push: | |
tags: | |
- "v*" | |
jobs: | |
create_release: | |
name: Create Github Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: Release ${{ github.ref_name }} | |
draft: true | |
build_normal_artifacts: | |
needs: [create_release] | |
name: ${{ matrix.os }}/${{ github.ref }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macOS-13, macOS-14, windows-latest] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set tag name | |
uses: olegtarasov/get-tag@v2.1 | |
id: tagName | |
with: | |
tagRegex: "v(.*)" | |
tagRegexGroup: 1 | |
- name: Install stack on macOS, where it is not present (https://github.com/freckle/stack-action/issues/80) | |
if: ${{ runner.os == 'macOS' }} | |
run: curl -sSL https://get.haskellstack.org/ | sh | |
- name: Build executable | |
uses: freckle/stack-action@v5 | |
id: stack | |
with: | |
test: false | |
stack-build-arguments: --copy-bins --ghc-options="-O2" | |
- name: Set binary path name | |
id: binarypath | |
run: | | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
newEXE="pileupCaller-$RUNNER_OS.exe" | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
newEXE="pileupCaller-$RUNNER_OS-$RUNNER_ARCH" | |
else | |
newEXE="pileupCaller-$RUNNER_OS" | |
fi | |
currentEXE="${{ steps.stack.outputs.local-bin }}/pileupCaller" | |
mv $currentEXE $newEXE | |
echo "BINARY_PATH=$newEXE" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Compress binary | |
if: ${{ runner.os != 'macOS' }} # upx is crashing for macOS Ventura or above! | |
uses: svenstaro/upx-action@v2 | |
with: | |
files: ${{ steps.binarypath.outputs.BINARY_PATH }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: ncipollo/release-action@v1 | |
with: | |
name: Release ${{ github.ref_name }} | |
draft: true | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
artifacts: ${{ steps.binarypath.outputs.BINARY_PATH }} | |
artifactContentType: application/octet-stream | |
build_centos_artifact: | |
needs: [create_release] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Build Docker image | |
run: docker build -t linux -f .github/workflows/Dockerfile.centos . | |
- name: Create container | |
run: docker create --name linuxcontainer linux | |
- name: Copy executable | |
run: docker cp linuxcontainer:/root/.local/bin/pileupCaller pileupCaller-conda-linux | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: ncipollo/release-action@v1 | |
with: | |
name: Release ${{ github.ref_name }} | |
draft: true | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
artifacts: pileupCaller-conda-linux | |
artifactContentType: application/octet-stream |