httptools 0.6.4 #31
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]+*" | |
paths: | |
- "httptools/_version.py" | |
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: httptools/_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@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: dist-version | |
path: dist/ | |
build-sdist: | |
needs: validate-release-request | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
with: | |
fetch-depth: 50 | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
- name: Build source distribution | |
run: | | |
python -m pip install -U setuptools wheel pip | |
python setup.py sdist | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: dist-sdist | |
path: dist/*.tar.* | |
build-wheels: | |
needs: validate-release-request | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
cibw_arch: ["auto64", "aarch64", "universal2"] | |
cibw_python: | |
- "cp38" | |
- "cp39" | |
- "cp310" | |
- "cp311" | |
- "cp312" | |
- "cp313" | |
exclude: | |
- os: ubuntu-latest | |
cibw_arch: universal2 | |
- os: macos-latest | |
cibw_arch: aarch64 | |
- os: windows-latest | |
cibw_arch: universal2 | |
- os: windows-latest | |
cibw_arch: aarch64 | |
defaults: | |
run: | |
shell: bash | |
env: | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
with: | |
fetch-depth: 50 | |
submodules: true | |
- name: Set up QEMU | |
if: matrix.os == 'ubuntu-latest' && matrix.cibw_arch == 'aarch64' | |
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 | |
with: | |
platforms: arm64 | |
- uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3 | |
env: | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_BUILD: ${{ matrix.cibw_python }}-* | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
CIBW_TEST_EXTRAS: "test" | |
CIBW_TEST_COMMAND: "python {project}/tests/__init__.py" | |
CIBW_TEST_COMMAND_WINDOWS: "python {project}\\tests\\__init__.py" | |
CIBW_TEST_SKIP: "*universal2:arm64" | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: dist-${{ matrix.os }}-${{ matrix.cibw_arch }}-${{ matrix.cibw_python }} | |
path: wheelhouse/*.whl | |
publish: | |
needs: [build-sdist, build-wheels] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
with: | |
fetch-depth: 5 | |
submodules: false | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
pattern: dist-* | |
merge-multiple: true | |
path: dist/ | |
- name: Extract Release Version | |
id: relver | |
run: | | |
set -e | |
echo ::set-output name=version::$(cat dist/VERSION) | |
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@5f9abb8f0677196a76ea77e64341fa8ca31dad4f | |
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@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
# password: ${{ secrets.TEST_PYPI_TOKEN }} | |
# repository_url: https://test.pypi.org/legacy/ |