-
Notifications
You must be signed in to change notification settings - Fork 15
93 lines (85 loc) · 3.41 KB
/
build-multi-pex.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
name: Build elastic-blast PEX files
on: [push, pull_request]
jobs:
build-single:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build PEX file
run: |
pip3 install wheel glob2
pip3 install -r requirements/test.txt
pex --python-shebang='/usr/bin/env python3' --disable-cache . -r requirements/base.txt --python=python${{ matrix.python-version }} -c elastic-blast -o elastic-blast
./elastic-blast --version
ls -l elastic-blast
md5sum elastic-blast > elastic-blast.md5
- name: Create tarball
run: tar -czvf elastic-blast-no-suffix.tar.gz elastic-blast elastic-blast.md5
- name: Produce downloadable artifact
uses: actions/upload-artifact@v3
with:
name: elastic-blast-no-suffix
path: elastic-blast-no-suffix.tar.gz
retention-days: 1
build-multiple:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build PEX file
run: |
pip3 install wheel glob2
pip3 install -r requirements/test.txt
pex --python-shebang='/usr/bin/env python3' --disable-cache . -r requirements/base.txt --python=python${{ matrix.python-version }} -c elastic-blast -o elastic-blast${{ matrix.python-version }}
./elastic-blast${{ matrix.python-version }} --version
ls -l ./elastic-blast${{ matrix.python-version }}
md5sum elastic-blast${{ matrix.python-version }} > elastic-blast${{ matrix.python-version }}.md5
- name: Create tarball
run: tar -czvf elastic-blast${{ matrix.python-version }}.tar.gz elastic-blast${{ matrix.python-version }} elastic-blast${{ matrix.python-version }}.md5
- name: Produce downloadable artifact
uses: actions/upload-artifact@v3
with:
name: elastic-blast-${{ matrix.python-version }}
path: elastic-blast${{ matrix.python-version }}.tar.gz
retention-days: 1
produce-archive:
needs: [build-single, build-multiple]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -lR
- name: Create tarball
run: |
tar axvf elastic-blast-no-suffix/elastic-blast-no-suffix.tar.gz
tar axvf elastic-blast-3.9/elastic-blast3.9.tar.gz
tar axvf elastic-blast-3.10/elastic-blast3.10.tar.gz
tar axvf elastic-blast-3.11/elastic-blast3.11.tar.gz
rm -fvr elastic-blast-*.tar.gz
tar -czvf ~/elastic-blast.tar.gz elastic-blast elastic-blast*md5 elastic-blast3.*
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: elastic-blast
path: ~/elastic-blast.tar.gz