-
Notifications
You must be signed in to change notification settings - Fork 10
103 lines (87 loc) · 3.13 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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-on-centos:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repo
# uses: actions/checkout@v2
# - 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: |
# for TOOL in genoStats pileupCaller vcf2eigenstrat; do
# docker cp linuxcontainer:/root/.local/bin/$TOOL $TOOL-linux
# done
# - name: update-release
# run: |
# for TOOL in genoStats pileupCaller vcf2eigenstrat; do
# 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
# done
build:
needs: [create_release]
name: ${{ matrix.os }}/${{ github.ref_name }}
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [macos-latest,ubuntu-latest,windows-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Haskell
uses: haskell-actions/setup@v2
with:
ghc-version: "9.4.7"
enable-stack: true
stack-version: "latest"
- name: Build
run: stack install --system-ghc
- name: Rename binaries (not windows)
if: ${{ matrix.os != 'windows-latest' }}
run: for TOOL in genoStats pileupCaller vcf2eigenstrat; do mv ~/.local/bin/$TOOL ~/.local/bin/$TOOL-$RUNNER_OS; done
- name: Rename binaries (windows)
if: ${{ matrix.os == 'windows-latest' }}
# stack on windows installs into <Home>\AppData\Roaming\local\bin
# the default shell on Windows is powershell, so we use that
run: |
foreach ($tool in "genoStats", "pileupCaller", "vcf2eigenstrat") { Rename-Item "$env:USERPROFILE\AppData\Roaming\local\bin\$tool.exe" "$tool-windows.exe" }
- name: Upload Release Asset (not windows)
uses: ncipollo/release-action@v1
if: ${{ matrix.os != 'windows-latest' }}
with:
name: Release ${{ github.ref_name }}
draft: true
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "~/.local/bin/*"
artifactContentType: application/octet-stream
- name: Upload Release Asset (windows)
uses: ncipollo/release-action@v1
if: ${{ matrix.os == 'windows-latest' }}
with:
name: Release ${{ github.ref_name }}
draft: true
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: '~/AppData/Roaming/local/bin/*.exe'
artifactContentType: application/octet-stream