Skip to content

Release

Release #11

Workflow file for this run

name: Release
on:
push:
# release on tag push
tags:
- '*'
jobs:
cibw_wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: "ubuntu-22.04"
arch: "x86_64"
- os: "ubuntu-22.04"
arch: "aarch64"
- os: "macos-14"
arch: "arm64"
macosx_deployment_target: "14.0"
- os: "windows-latest"
arch: "auto64"
triplet: "x64-windows"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones, plus cross-compile on macos
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_TEST_SKIP: "*_arm64 *universal2:arm64 *linux_i686"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* cp314-*
CIBW_SKIP: "*musllinux* *i686"
CIBW_BEFORE_ALL_LINUX: >
yum -y update && yum -y install epel-release && yum install -y re2-devel ninja-build
CIBW_BEFORE_ALL_MACOS: >
brew install re2 pybind11
# macos target should be at least 10.13 to get full c++17
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ matrix.macosx_deployment_target }}
CIBW_BEFORE_ALL_WINDOWS: >
vcpkg install pkgconf:${{ matrix.triplet }} re2:${{ matrix.triplet }}
&& vcpkg integrate install
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
CIBW_TEST_REQUIRES: ""
CIBW_TEST_COMMAND: ""
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
- name: Build sdist
run: |
pip install build
python -m build -s .
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
create_release:
needs: [build_sdist, cibw_wheels]
runs-on: ubuntu-22.04
steps:
- name: Get version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo ${{ env.VERSION }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
# download all artifacts to artifacts dir
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: artifacts
- name: Generate changes file
uses: sarnold/gitchangelog-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
- name: Create draft release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
name: Release ${{ env.VERSION }}
body_path: CHANGES.md
draft: false
prerelease: false
# uncomment below to upload wheels to github releases
files: artifacts/pyre2*
- uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
with:
user: __token__
password: ${{ secrets.pypi_password }}
packages_dir: artifacts/