fix(ci): release artifact keys #12
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: Release | |
on: | |
push: | |
# release on tag push | |
tags: | |
- '*' | |
jobs: | |
cibw_wheels: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-22.04, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.12' | |
- name: Prepare compiler environment for Windows | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64 | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements-cibw.txt | |
- name: Build wheels | |
env: | |
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* | |
CIBW_ARCHS_MACOS: "universal2" | |
CIBW_ARCHS_LINUX: "auto64" | |
CIBW_ARCHS_WINDOWS: "auto64" | |
CIBW_SKIP: "*musllinux*" | |
CIBW_BEFORE_ALL_LINUX: > | |
yum -y -q --enablerepo=extras install epel-release | |
&& yum install -y re2-devel ninja-build | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel show {wheel} && auditwheel repair -w {dest_dir} {wheel}" | |
CIBW_BEFORE_ALL_MACOS: > | |
brew install re2 pybind11 ninja | |
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.15 | |
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "pip uninstall -y delocate && pip install delocate && delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} -v {wheel}" | |
CIBW_BEFORE_ALL_WINDOWS: > | |
vcpkg install re2:x64-windows | |
&& vcpkg integrate install | |
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake' | |
CIBW_TEST_COMMAND: python -c "import re2" | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.os }} | |
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.12' | |
- name: Build sdist | |
run: | | |
pip install pep517 | |
python -m pep517.build -s . | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-source | |
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 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.12' | |
# download all artifacts to project dir | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
merge-multiple: true | |
path: dist | |
- 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@v1 | |
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: dist/cibw-wheels/pyre2-updated*.whl | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
if: ${{ github.actor == github.repository_owner && startsWith(github.ref, 'refs/tags') }} | |
with: | |
password: ${{ secrets.pypi_password }} | |
packages_dir: artifact/ |