Skip to content

chore(deps): update peter-evans/create-pull-request action to v8.1.1 #1152

chore(deps): update peter-evans/create-pull-request action to v8.1.1

chore(deps): update peter-evans/create-pull-request action to v8.1.1 #1152

Workflow file for this run

---
name: build ffi
on:
push:
tags:
- pact-python-ffi/*
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
STABLE_PYTHON_VERSION: '310'
HATCH_VERBOSE: '1'
FORCE_COLOR: '1'
CIBW_BUILD_FRONTEND: build
jobs:
complete:
name: Build FFI completion check
if: always()
permissions:
contents: none
runs-on: ubuntu-latest
needs:
- build-sdist
- build-wheels
- publish
steps:
- name: Failed
run: exit 1
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
build-sdist:
name: Build FFI source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
enable-cache: true
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
- name: Install hatch
run: uv tool install hatch
- name: Create source distribution
working-directory: pact-python-ffi
run: hatch build --target sdist
- name: Upload sdist
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: wheels-sdist
path: pact-python-ffi/dist/*.tar*
if-no-files-found: error
compression-level: 0
build-wheels:
name: Build FFI wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-15-intel
- os: macos-latest
- os: ubuntu-24.04-arm
- os: ubuntu-latest
- os: windows-11-arm
- os: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Create wheels
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
with:
package-dir: pact-python-ffi
env:
CIBW_BUILD: cp${{ env.STABLE_PYTHON_VERSION }}-*
HATCH_VERBOSE: '1'
- name: Upload wheels
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
if-no-files-found: error
compression-level: 0
publish:
name: Publish FFI wheels and sdist
if: >-
github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/pact-python-ffi/')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pact-python-ffi
needs:
- build-sdist
- build-wheels
permissions:
# Required for creating the release
contents: write
# Required for trusted publishing
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Install git cliff and typos
uses: taiki-e/install-action@cf39a74df4a72510be4e5b63348d61067f11e64a # v2.75.0
with:
tool: git-cliff,typos
- name: Update changelog
run: git cliff --verbose
working-directory: pact-python-ffi
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Generate release changelog
id: release-changelog
working-directory: pact-python-ffi
run: |
if ! git cliff \
--current \
--strip header \
--output ${{ runner.temp }}/release-changelog.md ; then
{
echo "> [!WARNING]"
echo ">"
echo "> No changelog generated. To be filled in."
} > ${{ runner.temp }}/release-changelog.md
fi
{
echo ""
echo "<details>"
echo "<summary>"
echo ""
echo "## Pull Requests"
echo ""
echo "</summary>"
echo ""
} >> ${{ runner.temp }}/release-changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Download wheels and sdist
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: wheelhouse
merge-multiple: true
- name: Generate release
id: release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
files: wheelhouse/*
body_path: ${{ runner.temp }}/release-changelog.md
draft: false
prerelease: false
generate_release_notes: true
- name: Push build artifacts to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
skip-existing: true
packages-dir: wheelhouse
- name: Create PR for changelog update
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: 'docs: update changelog for ${{ github.ref_name }}'
title: 'docs: update ffi changelog'
body: |
This PR updates the changelog for ${{ github.ref_name }}.
branch: docs/update-changelog
base: main