-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (89 loc) · 2.61 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
name: release
on:
push:
tags:
- 'v*'
jobs:
linux-wheels:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v1
- name: Build wheels
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
rustup default nightly
bash .github/workflows/build-wheels.sh
- uses: actions/upload-artifact@v1
with:
name: linux-wheels
path: wheelhouse/
osx-wheels:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "nightly"
default: true
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
run: |
python3 -m pip install maturin
maturin build --release
- uses: actions/upload-artifact@v1
with:
name: osx-${{ matrix.python-version }}-wheel
path: target/wheels
windows-wheels:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "nightly"
default: true
- uses: actions/setup-python@v2
- name: Build wheels
run: |
python -m pip install maturin
maturin build --release
- uses: actions/upload-artifact@v1
with:
name: windows-wheels
path: target/wheels
release-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: PyPI
url: ${{ steps.set_url.outputs.env_url }}
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ linux-wheels, osx-wheels, windows-wheels ]
steps:
- uses: actions/download-artifact@v2 # downloads all artifacts into subdir of current directory named artifact name
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Publish
env:
MATURIN_PASSWORD: ${{ secrets.MATURIN_PASSWORD }}
run: |
pip install maturin
maturin upload \
-u __token__ \
--skip-existing \
linux-wheels/* \
windows-wheels/* \
osx-*-wheel/*
- name: Set environment url
id: set_url
run: |
VERSION=$(echo $GITHUB_REF | sed -e "s#refs/tags/v##g")
echo "::set-output name=env_url::https://pypi.org/project/maturin/$VERSION"