Skip to content

Commit

Permalink
Merge pull request #31 from poseidon-framework/new_release_pipeline
Browse files Browse the repository at this point in the history
New release pipeline
  • Loading branch information
nevrome authored May 7, 2024
2 parents 8044823 + 2dac637 commit 82def75
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 42 deletions.
129 changes: 89 additions & 40 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Release

on:
# Trigger the workflow on the new 'v*' tag created
push:
tags:
- "v*"
Expand All @@ -11,53 +13,100 @@ jobs:
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-on-linux:

build_normal_artifacts:
needs: [create_release]
runs-on: ubuntu-latest
name: ${{ matrix.os }}/${{ github.ref }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macOS-13, macOS-14, windows-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t linux -f Dockerfile.linux .
- name: Create container
run: docker create --name linuxcontainer linux
- name: Copy executable
run: docker cp linuxcontainer:/root/.local/bin/xerxes xerxes-Linux
- name: Upload Release Asset
uses: ncipollo/release-action@v1
with:
name: Release ${{ github.ref_name }}
draft: true
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: xerxes-Linux
artifactContentType: application/octet-stream
build-on-mac:
- 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 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="xerxes-$RUNNER_OS.exe"
elif [ "$RUNNER_OS" == "macOS" ]; then
newEXE="xerxes-$RUNNER_OS-$RUNNER_ARCH"
else
newEXE="xerxes-$RUNNER_OS"
fi
currentEXE="${{ steps.stack.outputs.local-bin }}/xerxes"
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: macos-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Haskell
uses: haskell/actions/setup@v2
with:
enable-stack: true
- name: Build
run: stack install
- name: Copy executable
run: cp ~/.local/bin/xerxes xerxes-macOS
- name: Upload Release Asset
uses: ncipollo/release-action@v1
with:
name: Release ${{ github.ref_name }}
draft: true
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: xerxes-macOS
artifactContentType: application/octet-stream
- 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/xerxes xerxes-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: xerxes-conda-linux
artifactContentType: application/octet-stream
14 changes: 14 additions & 0 deletions CHANGELOGRELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# V1.0.1.1: new release pipeline

This minor release replaces the pipeline to produce static `xerxes` executables for every release.

Just like `trident`, `xerxes` will now be available in the following pre-compiled versions:

- `xerxes-conda-linux` (for bioconda)
- `xerxes-Linux` (build on Ubuntu 20.04 for X64 architecture)
- `xerxes-macOS-ARM64` (build on macOS 14 for ARM64 architecture)
- `xerxes-macOS-X64` (build on macOS 13 for X64 architecture)
- `xerxes-Windows`

`xerxes` now also depends on the latest poseidon-hs version 1.5.0.1.

# V1.0.1.0: FST fix and better user input checks

This release fixes a bug in the estimation of FST. We have now exactly implemented the estimator presented in Bhatia et al. 2013
Expand Down
2 changes: 1 addition & 1 deletion poseidon-analysis-hs.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: poseidon-analysis-hs
version: 1.0.1.0
version: 1.0.1.1
synopsis: A package with analysis-tools to work with Poseidon Genotype Data
description: The tools in this package analyse Poseidon-formatted genotype databases, a modular system for storing genotype data from thousands of individuals.
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ packages:

extra-deps:
- git: https://github.com/poseidon-framework/poseidon-hs
commit: c4460ec52f64a47ff0a292a26828fa507802c9a5
commit: 466870a0968aa093a31e02b74e9b802213ab29d8
- table-layout-0.9.1.0
- data-default-instances-base-0.1.0.1
- sequence-formats-1.7.0
Expand Down

0 comments on commit 82def75

Please sign in to comment.