-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (67 loc) · 2.1 KB
/
ci-cd.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
name: Build pydockrmsd
on:
push:
tags:
- "*"
jobs:
create_release:
if: contains(github.ref, 'v')
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
id: ${{ steps.create_release.outputs.id }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
build:
name: Build ${{ matrix.os }}
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04, macOS-10.15, windows-2019]
if: contains(github.ref, 'v')
steps:
- uses: actions/setup-python@v2
- name: Checkout code
uses: actions/checkout@v2
id: checkout
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.10.0
- name: Build wheels
id: build_installation
env:
version: ${{ github.ref }}
CIBW_ENVIRONMENT: "version=${{ github.ref }}"
run: |
python -m cibuildwheel --output-dir dist
- name: Upload Release Assets
id: upload-release-assets
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.create_release.outputs.id }}
assets_path: ./dist/
- name: Deploy to PyPI ${{ matrix.os }}
if: ${{ contains(github.ref, 'p') && matrix.os != 'windows-2019'}}
env:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install twine
twine upload -u __token__ -p $TWINE_PASSWORD dist/*
- name: Deploy to PyPI ${{ matrix.os }}
if: ${{ contains(github.ref, 'p') && matrix.os == 'windows-2019'}}
run: |
python -m pip install twine
twine upload -u __token__ -p ${{ secrets.PYPI_PASSWORD }} dist/*