Bump docker/setup-qemu-action from 3.0.0 to 3.2.0 #451
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build wheels | |
on: | |
pull_request: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
# Build the source distribution for PyPI | |
build_sdist: | |
name: Build sdist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Build sdist | |
run: | | |
python3.12 -m pip install --upgrade setuptools wheel | |
python3.12 setup.py sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
# Build binary distributions for PyPI | |
build_wheels: | |
name: Build on ${{ matrix.os }} for ${{matrix.cibw_python}} ${{matrix.cibw_arch}} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# Windows isn't working right now: https://github.com/caketop/python-starlark-go/issues/4 | |
os: [ubuntu-latest, macos-latest] | |
cibw_python: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"] | |
cibw_arch: ["i686", "x86_64", "aarch64", "arm64"] | |
include: | |
- cibw_arch: arm64 | |
goarch: arm64 | |
- cibw_arch: aarch64 | |
goarch: arm64 | |
- cibw_arch: x86_64 | |
goarch: amd64 | |
exclude: | |
- os: ubuntu-latest | |
cibw_arch: arm64 | |
- os: macos-latest | |
cibw_arch: i686 | |
- os: macos-latest | |
cibw_arch: aarch64 | |
- os: macos-latest | |
cibw_python: "cp37-*" | |
cibw_arch: arm64 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
if: runner.os != 'Linux' | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/[email protected] | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_BUILD: ${{ matrix.cibw_python }} | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
GOARCH: ${{ matrix.goarch }} | |
CGO_ENABLED: 1 | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: wheelhouse/starlark_go-*.whl | |
# Create a GitHub release | |
github_release: | |
name: Create GitHub release | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: "βοΈ Generate release changelog" | |
id: changelog | |
uses: heinrichreimer/[email protected] | |
with: | |
filterByMilestone: false | |
onlyLastTag: true | |
pullRequests: true | |
prWoLabels: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
verbose: true | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: ${{ steps.changelog.outputs.changelog }} | |
files: dist/**/* | |
# Test PyPI | |
test_pypi_publish: | |
name: Test publishing to PyPI | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
skip_existing: true | |
# Publish to PyPI | |
pypi_publish: | |
name: Publish to PyPI | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |