Skip to content

CD

CD #79

Workflow file for this run

name: CD
on:
workflow_dispatch:
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 3
CIBW_BUILD_VERBOSITY: 2
CIBW_BUILD_FRONTEND: 'pip'
CIBW_SKIP: "pp* *musllinux*"
jobs:
sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.12
- name: Build source distribution
run: |
pipx run build --sdist --outdir dist/
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: source_distribution
path: dist
if-no-files-found: error
windows_wheels:
name: Windows wheels (amd64)
runs-on: windows-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.12
- name: Set up Go toolchain
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.22.1'
cache: false
- name: Install MinGW compiler(s)
run: choco install mingw
- uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0
with:
package-dir: .
output-dir: wheelhouse
env:
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_WINDOWS: AMD64
CIBW_TEST_COMMAND: >
hugo version
hugo env --logLevel debug
- name: Upload wheels
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels_windows_amd64
path: ./wheelhouse/*.whl
if-no-files-found: error
linux_amd64_wheels:
name: Linux wheels (amd64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.8
- uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0
with:
package-dir: .
output-dir: wheelhouse
env:
CIBW_ARCHS_LINUX: x86_64
CIBW_BEFORE_ALL_LINUX: bash scripts/ci/tools/linux/install_go.sh
CIBW_ENVIRONMENT_LINUX: PATH=$PATH:$HOME/go_installed/go/bin
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ''
CIBW_TEST_COMMAND: >
hugo version
hugo env --logLevel debug
- name: Upload wheels
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels_linux_amd64
path: ./wheelhouse/*.whl
if-no-files-found: error
linux_aarch64_wheels:
name: Linux wheels (aarch64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.8
- name: Set up QEMU for emulation
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
with:
platforms: all
- uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0
with:
package-dir: .
output-dir: wheelhouse
env:
CIBW_ARCHS_LINUX: aarch64
CIBW_BEFORE_ALL_LINUX: bash scripts/ci/tools/linux/install_go.sh
CIBW_ENVIRONMENT_LINUX: PATH=$PATH:$HOME/go_installed/go/bin
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ''
CIBW_TEST_COMMAND: >
hugo version
hugo env --logLevel debug
- name: Upload wheels
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels_linux_aarch64
path: ./wheelhouse/*.whl
if-no-files-found: error
repair_linux_wheels:
name: Repair Linux wheels
runs-on: ubuntu-latest
needs: [linux_amd64_wheels, linux_aarch64_wheels]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Download Linux wheels for both architectures
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 #v4.1.4
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.12
- name: Repair Linux wheels to add conformant platform tags
run: |
mkdir wheelhouse_amd64
mkdir wheelhouse_aarch64
mkdir repaired_linux_wheels
cp linux_amd64_wheels/*.whl wheelhouse_amd64/
cp linux_aarch64_wheels/*.whl wheelhouse_aarch64/
python scripts/ci/tools/linux/repair_wheels.py ./wheelhouse_amd64 ./repaired_linux_wheels
python scripts/ci/tools/linux/repair_wheels.py ./wheelhouse_aarch64 ./repaired_linux_wheels
- name: Upload repaired Linux wheels
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: repaired_linux_wheels
path: ./repaired_linux_wheels/*.whl
if-no-files-found: error
macos_x86_64_wheels:
name: macOS wheels (x86_64)
runs-on: macos-13
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.12
- name: Set up Go toolchain
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.22.1'
cache: false
check-latest: true
- uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0
with:
package-dir: .
output-dir: wheelhouse
env:
CIBW_ARCHS_MACOS: x86_64
CIBW_BUILD: "cp312-*"
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ''
CIBW_TEST_COMMAND: >
hugo version
hugo env --logLevel debug
- name: Upload wheels
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels_macos_x86_64
path: ./wheelhouse/*.whl
if-no-files-found: error
macos_arm64_wheels:
name: macOS wheels (arm64)
runs-on: macos-14
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.12
- name: Set up Go toolchain
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.22.1'
cache: false
check-latest: true
- uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0
with:
package-dir: .
output-dir: wheelhouse
env:
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_MACOS: arm64
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ''
CIBW_TEST_COMMAND: >
hugo version
hugo env --logLevel debug
- name: Upload wheels
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels_macos_arm64
path: ./wheelhouse/*.whl
if-no-files-found: error
publish:
needs: [sdist, windows_wheels, repair_linux_wheels, macos_x86_64_wheels, macos_arm64_wheels]
name: Publish to PyPI or TestPyPI
environment: release
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download all wheels
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 #v4.1.4
with:
pattern: wheels_*
path: upload/
merge-multiple: true
- name: Download SDist
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 #v4.1.4
with:
name: source_distribution
path: upload/
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
if: github.event_name == 'release' && github.event.action == 'published'
with:
# Remember to tell (test-)pypi about this repo before publishing
# Remove this line to publish to PyPI
# repository-url: https://test.pypi.org/legacy/
packages-dir: upload
- name: Publish to GitHub Releases
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
if: github.event_name == 'release' && github.event.action == 'published'
with:
files: upload/*