-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
releng - update golang deps and provenance and trusted publishing (#173)
- Loading branch information
Showing
6 changed files
with
236 additions
and
172 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,28 +6,38 @@ on: | |
workflow_dispatch: | ||
inputs: {} | ||
env: | ||
CIBW_BUILD: "c39-* cp310-* cp311-* cp312-*" | ||
CIBW_BUILD: "cp310-* cp311-* cp312-*" | ||
jobs: | ||
|
||
Build-Linux: | ||
runs-on: ubuntu-latest | ||
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@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/[email protected] | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # ratchet:docker/setup-qemu-action@v2 | ||
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 | ||
with: | ||
platforms: arm64 | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@fff9ec32ed25a9c576750c91e06b410ed0c15db7 # ratchet:pypa/[email protected] | ||
uses: pypa/cibuildwheel@fff9ec32ed25a9c576750c91e06b410ed0c15db7 | ||
env: | ||
CIBW_ENVIRONMENT: PATH=$(pwd)/go/bin:$PATH | ||
CIBW_BEFORE_ALL: sh ci-setup-golang.sh | ||
CIBW_SKIP: "*musllinux*" | ||
CIBW_ARCHS: "x86_64 aarch64" | ||
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # ratchet:actions/upload-artifact@v3 | ||
CIBW_ARCHS: ${{ matrix.cibw_arch }} | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 | ||
with: | ||
name: wheels | ||
name: wheels-linux-${{ matrix.cibw_arch }} | ||
path: ./wheelhouse/*.whl | ||
|
||
Build-MacOS: | ||
strategy: | ||
matrix: | ||
|
@@ -39,35 +49,83 @@ jobs: | |
runs-on: macos-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/[email protected] | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Set up Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # ratchet:actions/setup-go@v3 | ||
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@fff9ec32ed25a9c576750c91e06b410ed0c15db7 # ratchet:pypa/[email protected] | ||
uses: pypa/cibuildwheel@fff9ec32ed25a9c576750c91e06b410ed0c15db7 | ||
env: | ||
CGO_ENABLED: 1 | ||
CIBW_ARCHS: ${{ matrix.cibw_arch }} | ||
GOARCH: ${{ matrix.go_arch }} | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # ratchet:actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 | ||
with: | ||
name: wheels | ||
name: wheels-macos-${{ matrix.cibw_arch }} | ||
path: ./wheelhouse/*.whl | ||
Upload: | ||
|
||
Gather: | ||
needs: [Build-Linux, Build-MacOS] | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
outputs: | ||
hash: ${{ steps.hash.outputs.hash }} | ||
steps: | ||
- uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # ratchet:actions/[email protected] | ||
- name: Fetch Wheels | ||
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 | ||
with: | ||
name: wheels | ||
pattern: "wheels-*" | ||
path: dist | ||
merge-multiple: true | ||
- name: Display downloaded artifacts | ||
run: ls -lh dist | ||
- uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # ratchet:pypa/[email protected] | ||
- 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: Fetch Wheels | ||
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 | ||
with: | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
pattern: "*" | ||
path: dist | ||
merge-multiple: true | ||
- name: Upload Release Assets | ||
run: | | ||
gh release upload ${{ github.ref_name }} dist/* | ||
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@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 | ||
with: | ||
pattern: "wheels-*" | ||
path: dist | ||
merge-multiple: true | ||
- name: Upload to PYPI | ||
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf |
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
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
Oops, something went wrong.