save #47
Workflow file for this run
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 pygo-jwt | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- release/pygo-jwt | |
- feature/pygo-jwt | |
env: | |
package: "pygo-jwt" | |
go_version: 1.21.8 | |
jobs: | |
build_sdist: | |
name: build sdist | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: pygo-jwt | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: install requirements | |
run: | | |
pip install pipenv | |
pipenv lock | |
pipenv requirements --dev > requirements.txt | |
pip install -r requirements.txt | |
- name: build sdist | |
run: python -m build -n --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: build-sdist-${{ env.package }}-${{ strategy.job-index }} | |
path: ${{ env.package }}/dist/* | |
build_wheels: | |
name: build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: [ubuntu-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
if: ${{ contains('linux', runner.os) }} | |
with: | |
platforms: arm64 | |
- uses: actions/setup-go@v5 | |
if: ${{ contains(fromJSON('["macos", "windows"]'), runner.os) }} | |
with: | |
go-version: ${{ env.go_version }} | |
- name: build wheels | |
uses: pypa/cibuildwheel@v2.17.0 | |
env: | |
CIBW_ARCHS_LINUX: auto aarch64 | |
with: | |
package-dir: pygo-jwt | |
output-dir: wheelhouse | |
config-file: "{package}/wheel.toml" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ env.package }}-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
publish_test: | |
if: github.event_name == 'workflow_dispatch' | |
needs: [build_sdist, build_wheels] | |
runs-on: ubuntu-latest | |
environment: testpypi | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
merge-multiple: true | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ |