From fe18b640f6c500afeebb58221c8da3f1acb51f27 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 20 Aug 2024 15:41:51 -0400 Subject: [PATCH] less hacky approach to append-version I don't have yq and this sharp edge has cut me twice now --- .github/workflows/build.yml | 6 ++++-- Makefile | 3 +-- README.md | 2 +- append-version | 0 4 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 append-version diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49008f1..15b33b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ jobs: 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: @@ -26,7 +27,8 @@ jobs: run: | git submodule update --init make sdist - echo "sdist_name=pyuwsgi-$(make print-version)" >> $GITHUB_OUTPUT + echo "sdist_name=pyuwsgi-$(make print-version)" >> "$GITHUB_OUTPUT" + echo "append_version=$(cat append-version)" >> "$GITHUB_OUTPUT" - uses: actions/upload-artifact@v3 with: @@ -88,7 +90,7 @@ jobs: env: CIBW_ARCHS: ${{ matrix.arch }} CIBW_SKIP: cp36-* cp38-macosx_arm64 cp313-* pp* - CIBW_ENVIRONMENT: APPEND_VERSION="" UWSGI_PROFILE=pyuwsginossl + 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)" diff --git a/Makefile b/Makefile index d0c09cf..a273291 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,7 @@ SHELL := bash # Figure out what version we're building UPSTREAM_VERSION := $(shell cd uwsgi; python setup.pyuwsgi.py --version) -# super fragile way of extracting `APPEND_VERSION` from workflow 🤮 -APPEND_VERSION := $(shell yq e '.jobs.build_wheels.steps[5].env.CIBW_ENVIRONMENT' .github/workflows/build.yml | cut -d' ' -f1 | cut -d= -f2) +APPEND_VERSION := $(shell cat append-version) VERSION := $(UPSTREAM_VERSION)$(APPEND_VERSION) HASH := $(shell cd uwsgi; git rev-parse HEAD) diff --git a/README.md b/README.md index e9c4b3f..52701bd 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ pip install -U setuptools twine To cut a new release: -1. Update `APPEND_VERSION` in `.github/workflows/build.yml` to add a pre-release tag to the upstream uWSGI version +1. Update `./append-version` to add a post-release tag (`.post1` for example) to the upstream uWSGI version (or leave empty to match the upstream version!) 2. Run `make update` to update uWSGI. uWSGI should be pinned to the [latest release](https://github.com/unbit/uwsgi/releases). 3. Push changes and wait for GH Actions to finish. 4. If GH Actions succeeds, tag the commit with the uWSGI version number and push the tag. diff --git a/append-version b/append-version new file mode 100644 index 0000000..e69de29