-
Notifications
You must be signed in to change notification settings - Fork 80
106 lines (94 loc) · 2.89 KB
/
build_wheel.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
name: cibuildwheel
on:
push:
branches: [latest]
tags: v*
pull_request:
schedule:
- cron: "0 0 * * *" # daily
jobs:
build_wheels:
name: Build wheels for ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [
linux-x86_64,
macos-x86_64,
macos-arm64,
]
include:
- build: linux-x86_64
os: ubuntu-20.04
arch: x86_64
macos_target: ''
- build: macos-x86_64
os: macos-latest
arch: x86_64
macos_target: 'MACOSX_DEPLOYMENT_TARGET=11.0 CARGO_BUILD_TARGET=x86_64-apple-darwin'
- build: macos-arm64
os: macos-latest
arch: arm64
macos_target: 'MACOSX_DEPLOYMENT_TARGET=11.0 CARGO_BUILD_TARGET=aarch64-apple-darwin'
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ENVIRONMENT_MACOS: ${{ matrix.macos_target }}
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
- uses: actions/upload-artifact@v3
with:
path: './wheelhouse/sourmash*.whl'
build_wasm:
runs-on: ubuntu-20.04
env:
PYODIDE_VERSION: "0.23.0"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11.2"
- run: |
pip install pyodide-build==${PYODIDE_VERSION} "pydantic<2"
pyodide config get emscripten_version # trigger setup
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
- uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-emscripten
- run: |
export RUSTC_BOOTSTRAP=1
pyodide build
- uses: actions/upload-artifact@v3
with:
path: './dist/sourmash*.whl'
release:
name: Publish wheels
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/v')
needs: [build_wheels, build_wasm]
steps:
- name: Fetch wheels from artifacts
id: fetch_artifacts
uses: actions/download-artifact@v3
with:
path: 'wheels/'
# if it matches a Python release tag, upload to github releases
# TODO: In the future, use the create-release and upload-release-assets actions
- name: Release
uses: fnkr/github-action-ghr@v1
env:
GHR_PATH: ${{steps.fetch_artifacts.outputs.download-path}}/artifact
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}