Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

less hacky approach to append-version #26

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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)"
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Empty file added append-version
Empty file.
Loading