Merge pull request #4 from poseidon-framework/discoverPacs #6
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
# taken from https://vrom911.github.io/blog/github-actions-releases | |
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_linux_artifact: | |
needs: [create_release] | |
name: ${{ matrix.os }}/GHC ${{ matrix.ghc }}/${{ github.ref_name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] # old version is on purpose: to compile with old libc | |
ghc: ["9.4.7"] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set tag name | |
uses: olegtarasov/[email protected] | |
id: tagName | |
with: | |
tagRegex: "v(.*)" | |
tagRegexGroup: 1 | |
- name: Setup Haskell | |
uses: haskell/actions/setup@v2 | |
id: setup-haskell-cabal | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
- name: Freeze | |
run: cabal freeze | |
- name: Build | |
run: | | |
mkdir dist | |
cabal install exe:qjanno --install-method=copy --overwrite-policy=always --installdir=dist -fembed_data_files | |
- name: Set binary path name | |
id: binarypath | |
run: | | |
currentEXE="./dist/qjanno" | |
newEXE="qjanno-$RUNNER_OS" | |
mv $currentEXE $newEXE | |
echo "BINARY_PATH=$newEXE" >> $GITHUB_OUTPUT | |
- name: Compress binary | |
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_mac_artifact: | |
needs: [create_release] | |
name: ${{ matrix.os }}/GHC ${{ matrix.ghc }}/${{ github.ref_name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macOS-latest] | |
ghc: ["9.4.7"] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set tag name | |
uses: olegtarasov/[email protected] | |
id: tagName | |
with: | |
tagRegex: "v(.*)" | |
tagRegexGroup: 1 | |
- name: Install pkgconfig (for the dependency "digest") | |
run: brew install pkg-config | |
- name: Setup Haskell | |
uses: haskell/actions/setup@v2 | |
id: setup-haskell-cabal | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
- name: Freeze | |
run: | | |
: # simdutf doesn't build on macOS any more, so we need to set a flag to ignore it when building the text package | |
cabal freeze --constraint="any.text >= 2.0.1" --constraint="any.text -simdutf" | |
- name: Build | |
run: | | |
mkdir dist | |
cabal install exe:qjanno --install-method=copy --overwrite-policy=always --installdir=dist -fembed_data_files | |
- name: Set binary path name | |
id: binarypath | |
run: | | |
currentEXE="./dist/qjanno" | |
newEXE="qjanno-$RUNNER_OS" | |
mv $currentEXE $newEXE | |
echo "BINARY_PATH=$newEXE" >> $GITHUB_OUTPUT | |
- name: Compress binary | |
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_windows_artifact: | |
needs: [create_release] | |
name: ${{ matrix.os }}/GHC ${{ matrix.ghc }}/${{ github.ref_name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
ghc: ["9.4.7"] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set tag name | |
uses: olegtarasov/[email protected] | |
id: tagName | |
with: | |
tagRegex: "v(.*)" | |
tagRegexGroup: 1 | |
- name: Setup Haskell | |
uses: haskell/actions/setup@v2 | |
id: setup-haskell-cabal | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
- name: Freeze | |
run: | | |
cabal freeze | |
- name: Build | |
run: | | |
mkdir dist | |
cabal install exe:qjanno --install-method=copy --overwrite-policy=always --installdir=dist -fembed_data_files | |
- name: Set binary path name | |
id: binarypath | |
run: | | |
Rename-Item -Path "./dist/qjanno.exe" -NewName "qjanno-Windows.exe" | |
echo "BINARY_PATH=./dist/qjanno-Windows.exe" >> $env:GITHUB_OUTPUT | |
- name: Compress binary | |
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 |