Debug release #51
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: | |
pull_request: | |
branches: | |
- "master" | |
- "ci" | |
- "[0-9]+.[0-9x]+*" | |
jobs: | |
validate-release-request: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Validate release PR | |
uses: edgedb/action-release/validate-pr@bae6b9134e872166b43d218dd79397c851c41c9a | |
id: checkver | |
with: | |
require_team: Release Managers | |
require_approval: no | |
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }} | |
version_file: uvloop/_version.py | |
version_line_pattern: | | |
__version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"]) | |
- name: Stop if not approved | |
if: steps.checkver.outputs.approved != 'true' | |
run: | | |
echo ::error::PR is not approved yet. | |
exit 1 | |
- name: Store release version for later use | |
env: | |
VERSION: ${{ steps.checkver.outputs.version }} | |
run: | | |
mkdir -p dist/ | |
echo "${VERSION}" > dist/VERSION | |
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | |
with: | |
name: dist | |
path: dist/ | |
build-sdist: | |
needs: validate-release-request | |
runs-on: ubuntu-22.04 | |
env: | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
steps: | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
with: | |
fetch-depth: 50 | |
submodules: true | |
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 | |
with: | |
python-version: 3.x | |
- name: Build source distribution | |
run: | | |
python -m pip install --upgrade setuptools wheel pip | |
python setup.py sdist | |
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | |
with: | |
name: dist | |
path: dist/*.tar.* | |
build-wheels: | |
needs: validate-release-request | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
cibw_python: ["cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"] | |
cibw_arch: ["x86_64", "aarch64", "universal2"] | |
exclude: | |
- os: ubuntu-latest | |
cibw_arch: universal2 | |
- os: macos-latest | |
cibw_arch: aarch64 | |
- os: macos-latest | |
cibw_python: "cp37-*" | |
cibw_arch: universal2 | |
defaults: | |
run: | |
shell: bash | |
env: | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
steps: | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
with: | |
fetch-depth: 50 | |
submodules: true | |
- name: Set up QEMU | |
if: matrix.os == 'ubuntu-latest' && matrix.cibw_arch == 'aarch64' | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | |
with: | |
platforms: arm64 | |
- name: Install macOS deps | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
brew install gnu-sed libtool autoconf automake | |
- uses: pypa/cibuildwheel@fff9ec32ed25a9c576750c91e06b410ed0c15db7 # v2.16.2 | |
env: | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_BUILD: ${{ matrix.cibw_python }} | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
CIBW_TEST_SKIP: "*universal2:arm64" | |
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | |
with: | |
name: dist | |
path: wheelhouse/*.whl | |
publish: | |
needs: [build-sdist, build-wheels] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
with: | |
fetch-depth: 5 | |
submodules: false | |
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: dist | |
path: dist/ | |
- name: Extract Release Version | |
id: relver | |
run: | | |
set -e | |
echo version=$(cat dist/VERSION) >> $GITHUB_OUTPUT | |
rm dist/VERSION | |
- name: Merge and tag the PR | |
uses: edgedb/action-release/merge@bae6b9134e872166b43d218dd79397c851c41c9a | |
with: | |
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }} | |
ssh_key: ${{ secrets.RELEASE_BOT_SSH_KEY }} | |
gpg_key: ${{ secrets.RELEASE_BOT_GPG_KEY }} | |
gpg_key_id: "5C468778062D87BF!" | |
tag_name: v${{ steps.relver.outputs.version }} | |
- name: Publish Github Release | |
uses: elprans/gh-action-create-release@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.relver.outputs.version }} | |
release_name: v${{ steps.relver.outputs.version }} | |
target: ${{ github.event.pull_request.base.ref }} | |
body: ${{ github.event.pull_request.body }} | |
draft: false | |
- run: | | |
ls -al dist/ | |
- name: Upload to PyPI | |
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10 | |
with: | |
user: __token__ | |
# password: ${{ secrets.PYPI_TOKEN }} | |
password: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ |