-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (112 loc) · 3.94 KB
/
dbuild-macos.yml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: macos ldc build
on: [push, pull_request]
jobs:
macos-build:
name: macos dub build
strategy:
matrix:
os: [macos-latest]
dc: [ldc-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}
- name: Install htslib deps
run: |
brew install xz autoconf automake cython
- name: Get dhtslib commit
id: get-dhtslib-commit
run: echo "::set-output name=sha_short::$(git rev-parse --short :dhtslib)"
- name: Cache dhtslib
id: cache-dhtslib
uses: actions/cache@v2
with:
path: dhtslib
key: ${{ runner.os}}-dhtslib-${{ steps.get-dhtslib-commit.outputs.sha_short }}
- name: Build htslib
if: steps.cache-dhtslib.outputs.cache-hit != 'true'
run: |
cd dhtslib/htslib
autoreconf -i
./configure
make
- name: Install htslib
run: |
cd dhtslib/htslib
sudo make install
- name: Setup additional test files
run: |
cd dhtslib/htslib
cd test
cd tabix
bgzip -c gff_file.gff > gff_file.gff.gz
tabix gff_file.gff.gz
bgzip -c bed_file.bed > bed_file.bed.gz
tabix bed_file.bed.gz
bgzip -c vcf_file.vcf > vcf_file.vcf.gz
tabix vcf_file.vcf.gz
- name: Run tests
run: dub build -b release
env:
LIBRARY_PATH: /usr/local/lib
- name: fix binary and compress
run: |
install_name_tool -change /usr/local/lib/libhts.3.dylib @rpath/libhts.3.dylib recontig
tar -czvf recontig.darwin-amd64.tar.gz recontig
- name: upload osx artifact
uses: actions/upload-artifact@v2
with:
name: recontig-osx
path: recontig.darwin-amd64.tar.gz
docker-build-and-release:
name: release with static linux binary
needs: macos-build
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the tag
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed 's/^v//')
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push recontig image
id: docker_build_recontig
uses: docker/build-push-action@v2
with:
file: ./build.dockerfile
push: true
tags: charesgregory/recontig:latest,charesgregory/recontig:${{ steps.get_version.outputs.VERSION }}
- name: extract recontig binary
uses: shrink/actions-docker-extract@v1
id: extract
with:
image: charesgregory/recontig:latest
path: /home/recontig/recontig
- name: compress binary
run: tar -czvf recontig.many-linux-x86_64.tar.gz ${{ steps.extract.outputs.destination }}/recontig
- name: Download osx binary
uses: actions/download-artifact@v2
with:
name: recontig-osx
- name: Release
uses: softprops/action-gh-release@v1
with:
files: recontig.many-linux-x86_64.tar.gz,recontig.darwin-amd64.tar.gz
generate_release_notes: true
draft: true
# - name: Upload coverage
# run: bash <(curl -s https://codecov.io/bash)