Release #85
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: Release | |
on: | |
push: | |
tags: | |
- v* | |
workflow_dispatch: | |
inputs: {} | |
env: | |
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*" | |
jobs: | |
Build-Linux: | |
strategy: | |
matrix: | |
include: | |
- runner: ubuntu-latest | |
cibw_arch: aarch64 | |
- runner: ubuntu-latest | |
cibw_arch: x86_64 | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 | |
with: | |
platforms: arm64 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce | |
env: | |
CIBW_ENVIRONMENT: PATH=$(pwd)/go/bin:$PATH | |
CIBW_BEFORE_ALL: sh ci-setup-golang.sh | |
CIBW_SKIP: "*musllinux*" | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 | |
with: | |
name: wheels-linux-${{ matrix.cibw_arch }} | |
path: ./wheelhouse/*.whl | |
Build-Windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
- name: Set up Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 | |
with: | |
go-version: "1.21.5" | |
cache: true | |
cache-dependency-path: "gotfparse/go.sum" | |
- name: Build wheels | |
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce | |
env: | |
CGO_ENABLED: 1 | |
CIBW_ARCHS: AMD64 | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 | |
with: | |
name: wheels-windows | |
path: ./wheelhouse/*.whl | |
Build-MacOS: | |
strategy: | |
matrix: | |
include: | |
- cibw_arch: "x86_64" | |
go_arch: "amd64" | |
- cibw_arch: "arm64" | |
go_arch: "arm64" | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
- name: Set up Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 | |
with: | |
go-version: "1.21.5" | |
cache: true | |
cache-dependency-path: "gotfparse/go.sum" | |
- name: Build wheels | |
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce | |
env: | |
CGO_ENABLED: 1 | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
GOARCH: ${{ matrix.go_arch }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 | |
with: | |
name: wheels-macos-${{ matrix.cibw_arch }} | |
path: ./wheelhouse/*.whl | |
Gather: | |
needs: [Build-Linux, Build-MacOS, Build-Windows] | |
runs-on: ubuntu-latest | |
outputs: | |
hash: ${{ steps.hash.outputs.hash }} | |
steps: | |
- name: Fetch Wheels | |
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 | |
with: | |
pattern: "wheels-*" | |
path: dist | |
merge-multiple: true | |
- name: Display downloaded artifacts | |
run: ls -lh dist | |
- name: Generate Hashes | |
id: hash | |
run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT | |
Provenance: | |
needs: [Gather] | |
permissions: | |
actions: read | |
id-token: write | |
contents: write | |
# Can't pin with hash due to how this workflow works. | |
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | |
with: | |
base64-subjects: ${{ needs.Gather.outputs.hash }} | |
Release: | |
runs-on: ubuntu-latest | |
needs: [Provenance] | |
permissions: | |
contents: write | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
- name: Fetch Wheels | |
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 | |
with: | |
pattern: "*" | |
path: dist | |
merge-multiple: true | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "dist/*" | |
token: ${{ github.token }} | |
draft: false | |
generateReleaseNotes: true | |
Upload: | |
needs: [Release] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
permissions: | |
id-token: write | |
steps: | |
- name: Fetch Wheels | |
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 | |
with: | |
pattern: "wheels-*" | |
path: dist | |
merge-multiple: true | |
- name: Upload to PYPI | |
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 |