Skip to content

💞 Bump to Hugo 0.125.0 #234

💞 Bump to Hugo 0.125.0

💞 Bump to Hugo 0.125.0 #234

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 3
jobs:
style:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.12
- name: Run style checks
run: pipx run nox -s lint
build_wheels:
needs: [style]
name: ${{ matrix.runs-on }}-python-${{ matrix.python-version }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12", "3.13"]
runs-on: [ubuntu-latest, macos-13, macos-14, windows-latest]
exclude:
# https://github.com/actions/setup-python/issues/808
- python-version: "3.8"
runs-on: macos-14
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Set up Go toolchain
id: setup-go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.22.2'
cache: false
check-latest: true
- name: Install MinGW on Windows
if: matrix.runs-on == 'windows-latest'
run: choco install mingw
- name: Restore Hugo builder cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./hugo_cache/
key: ${{ matrix.runs-on }}-hugo-${{ steps.setup-go.outputs.go-version }}
- name: Install Python dependencies
run: python -m pip install build virtualenv nox
- name: Build binary distribution (wheel)
run: |
python -m build --wheel . --outdir wheelhouse/
- name: Test entry points for package
run: nox -s venv
experimental:
needs: [style]
name: ${{ matrix.runs-on }}-${{ matrix.architecture }}-python-${{ matrix.python-version }}
env:
CIBW_BUILD_VERBOSITY: 2
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, windows-latest]
architecture: [arm64, i686]
python-version: [3.8, 3.12, 3.13]
# Exclude i686 on Linux for all Python versions
# Test just one Python version on Windows for now
exclude:
- runs-on: ubuntu-latest
architecture: i686
- python-version: "3.8"
runs-on: windows-latest
- python-version: "3.13"
runs-on: windows-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Set up Go toolchain
id: setup-go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.22.2'
cache: false
check-latest: true
- uses: goto-bus-stop/setup-zig@7ab2955eb728f5440978d5824358023be3a2802d # v2.2.0
with:
version: 0.11.0
- name: Restore Hugo builder cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./hugo_cache/
key: ${{ matrix.runs-on }}-${{ matrix.architecture}}-hugo-experimental-${{ steps.setup-go.outputs.go-version }}
- name: Install Python dependencies
run: python -m pip install build virtualenv nox auditwheel
- name: Build binary distribution (wheel) on Linux
if: matrix.runs-on == 'ubuntu-latest'
# Cross-compile for arm64 target via Zig toolchain
env:
GOARCH: arm64
# We are on ubuntu amd64, so set target as arm64
CC: zig cc -target aarch64-linux-gnu
CXX: zig c++ -target aarch64-linux-gnu
run: |
python -m build --wheel . --outdir wheelhouse/
# can't repair arm64 wheels on Linux x86_64 right now
# auditwheel repair --plat manylinux_2_28_aarch64 -w wheelhouse/ dist/*.whl
- name: Build binary distribution (wheel) on Windows (arm64)
if: matrix.runs-on == 'windows-latest' && matrix.architecture == 'arm64'
# We need to use cibuildwheel because it has experimental support for cross-compiling
# to arm64 and setup-python does not have arm64 support on Windows right now
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0
with:
package-dir: .
output-dir: wheelhouse
# Cross-compile for arm64 target via Zig toolchain
env:
GOARCH: arm64
# We are on Windows amd64, so set target as arm64
CC: zig cc -target aarch64-windows-gnu
CXX: zig c++ -target aarch64-windows-gnu
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_WINDOWS: ARM64
CIBW_TEST_SKIP: "*-win_arm64"
# Note: cibuildwheel will manage installing 32-bit Python on Windows. We
# do not need to do that manually unless we use setup-python instead.
- name: Build binary distribution (wheel) on Windows (i686)
if: matrix.runs-on == 'windows-latest' && matrix.architecture == 'i686'
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0
with:
package-dir: .
output-dir: wheelhouse
# Cross-compile for i686 target via Zig toolchain
env:
GOARCH: 386
CC: zig cc -target x86-windows-gnu
CXX: zig c++ -target x86-windows-gnu
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_WINDOWS: x86
CIBW_TEST_COMMAND: >
hugo version
hugo env --logLevel debug
- name: Upload artifacts for debugging
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels_${{ matrix.runs-on }}_${{ matrix.architecture }}_py${{ matrix.python-version }}
path: ./wheelhouse/*.whl
inspect_distributions:
needs: [style]
name: inspect-sdist-wheel-contents
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.12
- name: Build source distribution (SDist) and binary distribution (wheel)
run: |
git apply scripts/ci/tools/patches/0001-use-temporary-directory-to-store-eggs.patch
pipx run build --sdist --wheel . --outdir dist/
pipx run twine check dist/* --strict
- name: Build, inspect, and display contents of distributions
shell: bash
run: |
mkdir -p output/sdist
tar -xf dist/*.tar.gz -C output/sdist
echo -e '## View source distribution (SDist) contents\n' >> $GITHUB_STEP_SUMMARY
echo -e '```\n' >> $GITHUB_STEP_SUMMARY
(cd output/sdist && tree -a * | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY)
echo -e '\n```\n' >> $GITHUB_STEP_SUMMARY
mkdir -p output/wheel
pipx run wheel unpack dist/*.whl -d output/wheel
echo -e '## View binary distribution (wheel) contents\n' >> $GITHUB_STEP_SUMMARY
echo -e '```\n' >> $GITHUB_STEP_SUMMARY
(cd output/wheel && tree -a * | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY)
echo -e '\n```\n' >> $GITHUB_STEP_SUMMARY