less hacky approach to append-version #117
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: Build | |
on: | |
push: | |
branches: [main, test-me-*] | |
tags: '*' | |
pull_request: | |
jobs: | |
build_sdist: | |
name: Build sdist | |
runs-on: ubuntu-latest | |
outputs: | |
sdist_name: ${{ steps.build_sdist.outputs.sdist_name }} | |
append_version: ${{ steps.build_sdist.outputs.append_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Patch packaging | |
run: ./patch-uwsgi-packaging.sh uwsgi | |
- name: Build sdist | |
id: build_sdist | |
run: | | |
git submodule update --init | |
make sdist | |
echo "sdist_name=pyuwsgi-$(make print-version)" >> "$GITHUB_OUTPUT" | |
echo "append_version=$(cat append-version)" >> "$GITHUB_OUTPUT" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pre_build | |
path: pre_build.sh | |
build_wheels: | |
name: Build wheels for ${{ matrix.os }} ${{ matrix.arch }} | |
needs: [build_sdist] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- {os: ubuntu-latest, arch: aarch64} | |
- {os: ubuntu-latest, arch: i686} | |
- {os: ubuntu-latest, arch: x86_64} | |
- {os: macos-13, arch: x86_64} | |
- {os: macos-14, arch: arm64} | |
fail-fast: false | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pre_build | |
path: . | |
- name: Unpack sdist | |
run: | | |
tar -xvzf "dist/${{ needs.build_sdist.outputs.sdist_name }}.tar.gz" | |
rm -rf dist | |
chmod +x pre_build.sh | |
- name: Set up QEMU | |
if: matrix.arch == 'aarch64' | |
uses: docker/setup-qemu-action@v1 | |
with: | |
platforms: all | |
- name: avoid homebrew pcre2 | |
if: matrix.os == 'macos-14' | |
run: brew unlink pcre2 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
with: | |
output-dir: dist | |
package-dir: ./${{ needs.build_sdist.outputs.sdist_name }} | |
env: | |
CIBW_ARCHS: ${{ matrix.arch }} | |
CIBW_SKIP: cp36-* cp38-macosx_arm64 cp313-* pp* | |
CIBW_ENVIRONMENT: APPEND_VERSION=${{ needs.build_sdist.outputs.append_version }} UWSGI_PROFILE=pyuwsginossl | |
CIBW_TEST_COMMAND: "pyuwsgi --help" | |
CIBW_BEFORE_BUILD_MACOS: "find . -name '*.o' -delete && IS_MACOS=1 ./pre_build.sh" | |
CIBW_BEFORE_BUILD_LINUX: "find . -name '*.o' -delete && ./pre_build.sh && (yum install -y zlib-devel || apk add zlib-dev)" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
verify: | |
name: Verify wheels | |
runs-on: ubuntu-latest | |
needs: [build_wheels] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Verify wheels | |
run: ls -lh dist | |
pypi-publish: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
needs: [verify] | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/pyuwsgi | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |