-
Notifications
You must be signed in to change notification settings - Fork 16
108 lines (92 loc) · 2.8 KB
/
build_wheels.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
name: Build Python Wheels
on:
push:
tags:
- 'v\d+\.\d+\.[0-9a-z]+'
repository_dispatch:
types: manual-trigger
jobs:
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0 # unshallow fetch for setuptools-scm
- name: Install Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Build wheels (Python 3.7 through 3.9)
uses: pypa/cibuildwheel@v2.11.1
with:
output-dir: dist
env:
CIBW_BUILD: "cp37* cp38* cp39*"
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_ARCHS_WINDOWS: AMD64
CIBW_ARCHS_LINUX: x86_64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_SKIP: "*musllinux*"
CIBW_ENVIRONMENT: "CFLAGS='-g0'"
- name: Build wheels (Python 3.10 only)
uses: pypa/cibuildwheel@v2.11.1
with:
output-dir: dist
env:
CIBW_BUILD: "cp310*"
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_ARCHS_WINDOWS: AMD64
CIBW_ARCHS_LINUX: x86_64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_SKIP: "*musllinux*"
CIBW_ENVIRONMENT: "CFLAGS='-g0'"
- name: Build sdist (Ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
python -m pip install --upgrade pip
python -m pip install build>=0.7.0
python -m build --sdist
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: wheelstorage
path: ./dist/*
if-no-files-found: error
retention-days: 30
publish_release:
name: Publish Release
needs: build_wheels
runs-on: ubuntu-latest
steps:
- name: Get date & flat tag
id: date_tag
run: |
export DATE=$(TZ=US/Pacific date +'%B-%-d-%Y')
echo $DATE
export FLAT_TAG=$(echo ${GITHUB_REF##*/} | sed 's/\.//g')
echo $FLAT_TAG
echo ::set-output name=TODAY::$DATE
echo ::set-output name=VERSION::$FLAT_TAG
shell: bash
- name: Download release assets
uses: actions/download-artifact@v3
with:
name: wheelstorage
path: dist
- name: Publish dist(s) to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: '[Release Notes](https://github.com/adobe-type-tools/psautohint/blob/master/NEWS.md#${{ steps.date_tag.outputs.VERSION }}---${{ steps.date_tag.outputs.TODAY }})'
prerelease: true
files: ./dist/*.tar.gz