Skip to content

Commit 43f08ed

Browse files
committed
Publish uvloop 0.23.0 from existing release artifacts
1 parent 1ff8082 commit 43f08ed

1 file changed

Lines changed: 25 additions & 182 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 25 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -1,203 +1,46 @@
11
name: Release
2+
run-name: Publish uvloop 0.23.0 once
23

34
on:
4-
pull_request:
5+
push:
56
branches:
6-
- "master"
7-
- "ci"
8-
- "[0-9]+.[0-9x]+*"
9-
paths:
10-
- "uvloop/_version.py"
7+
- publish-0.23.0-once
118

129
jobs:
13-
validate-release-request:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Validate release PR
17-
uses: edgedb/action-release/validate-pr@bae6b9134e872166b43d218dd79397c851c41c9a
18-
id: checkver
19-
with:
20-
require_team: Release Managers
21-
require_approval: no
22-
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
23-
version_file: uvloop/_version.py
24-
version_line_pattern: |
25-
__version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
26-
27-
- name: Stop if not approved
28-
if: steps.checkver.outputs.approved != 'true'
29-
run: |
30-
echo ::error::PR is not approved yet.
31-
exit 1
32-
33-
- name: Store release version for later use
34-
env:
35-
VERSION: ${{ steps.checkver.outputs.version }}
36-
run: |
37-
mkdir -p dist/
38-
echo "${VERSION}" > dist/VERSION
39-
40-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
41-
with:
42-
name: dist-version
43-
path: dist/
44-
45-
build-sdist:
46-
needs: validate-release-request
47-
runs-on: ubuntu-22.04
48-
49-
env:
50-
PIP_DISABLE_PIP_VERSION_CHECK: 1
51-
52-
steps:
53-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
54-
with:
55-
fetch-depth: 50
56-
submodules: true
57-
58-
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
59-
with:
60-
python-version: 3.x
61-
62-
- name: Build source distribution
63-
run: |
64-
python -m pip install --upgrade setuptools wheel pip
65-
python setup.py sdist
66-
67-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
68-
with:
69-
name: dist-sdist
70-
path: dist/*.tar.*
71-
72-
build-wheels:
73-
needs: validate-release-request
74-
runs-on: ${{ matrix.os }}
75-
strategy:
76-
fail-fast: false
77-
matrix:
78-
os:
79-
- ubuntu-latest
80-
- ubuntu-22.04-arm
81-
- macos-15-intel
82-
- macos-latest
83-
python:
84-
- "cp38"
85-
- "cp39"
86-
- "cp310"
87-
- "cp311"
88-
- "cp312"
89-
- "cp313"
90-
- "cp314"
91-
- "cp314t"
92-
- "cp315"
93-
- "cp315t"
94-
include:
95-
- os: ubuntu-latest
96-
cibw_arch: x86_64
97-
- os: ubuntu-22.04-arm
98-
cibw_arch: aarch64
99-
# Use native OpenSSL when compiling x86_64 test dependencies.
100-
- os: macos-15-intel
101-
cibw_arch: x86_64
102-
- os: macos-latest
103-
cibw_arch: universal2
104-
105-
defaults:
106-
run:
107-
shell: bash
108-
109-
env:
110-
PIP_DISABLE_PIP_VERSION_CHECK: 1
111-
CIBW_BUILD_VERBOSITY: 1
112-
CIBW_BUILD: ${{ matrix.python }}-*
113-
CIBW_ARCHS: ${{ matrix.cibw_arch }}
114-
# Let tests inside Linux containers recognize GitHub CI.
115-
CIBW_ENVIRONMENT_PASS_LINUX: GITHUB_WORKFLOW
116-
# Exercise arm64 here; x86_64 wheels have their own test jobs.
117-
CIBW_TEST_SKIP: "*universal2:x86_64"
118-
119-
steps:
120-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
121-
with:
122-
fetch-depth: 50
123-
submodules: true
124-
125-
- name: Install macOS deps
126-
if: startsWith(matrix.os, 'macos')
127-
run: |
128-
brew install gnu-sed libtool autoconf automake openssl@3
129-
echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV"
130-
131-
# cibuildwheel 4 added Python 3.15 but removed Python 3.8.
132-
- uses: pypa/cibuildwheel@7c619efba910c04005a835b110b057fc28fd6e93 # v3.2.0
133-
if: matrix.python == 'cp38'
134-
135-
- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
136-
if: matrix.python != 'cp38'
137-
env:
138-
CIBW_BEFORE_ALL_LINUX: >-
139-
${{ matrix.python == 'cp315t' && 'bash {project}/.github/workflows/install-linux-test-deps.sh' || '' }}
140-
# Build universal2 wheels, but compile their test dependencies for arm64.
141-
CIBW_TEST_ENVIRONMENT_MACOS: >-
142-
${{ matrix.cibw_arch == 'universal2'
143-
&& 'ARCHFLAGS="-arch arm64" _PYTHON_HOST_PLATFORM="macosx-11.0-arm64"'
144-
|| '' }}
145-
146-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
147-
with:
148-
name: dist-wheels-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.cibw_arch }}
149-
path: wheelhouse/*.whl
150-
151-
publish:
152-
needs: [build-sdist, build-wheels]
10+
# This workflow exists only on the temporary publishing branch.
11+
# Artifacts: https://github.com/MagicStack/uvloop/actions/runs/36759309178
12+
publish-0-23-0:
13+
if: github.event.deleted == false
15314
runs-on: ubuntu-latest
15415
permissions:
155-
contents: write
16+
actions: read
17+
contents: read
15618
id-token: write
15719

15820
steps:
159-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
160-
with:
161-
fetch-depth: 5
162-
submodules: false
163-
16421
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
16522
with:
23+
github-token: ${{ github.token }}
24+
repository: MagicStack/uvloop
25+
run-id: 36759309178
16626
pattern: dist-*
167-
merge-multiple: true
168-
path: dist/
27+
path: artifacts/
16928

170-
- name: Extract Release Version
171-
id: relver
29+
- name: Verify and collect uvloop 0.23.0 distributions
30+
shell: bash
17231
run: |
173-
set -e
174-
echo version=$(cat dist/VERSION) >> $GITHUB_OUTPUT
175-
rm dist/VERSION
176-
177-
- name: Merge and tag the PR
178-
uses: edgedb/action-release/merge@bae6b9134e872166b43d218dd79397c851c41c9a
179-
with:
180-
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
181-
ssh_key: ${{ secrets.RELEASE_BOT_SSH_KEY }}
182-
gpg_key: ${{ secrets.RELEASE_BOT_GPG_KEY }}
183-
gpg_key_id: "5C468778062D87BF!"
184-
tag_name: v${{ steps.relver.outputs.version }}
185-
186-
- name: Publish Github Release
187-
uses: elprans/gh-action-create-release@master
188-
env:
189-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
190-
with:
191-
tag_name: v${{ steps.relver.outputs.version }}
192-
release_name: v${{ steps.relver.outputs.version }}
193-
target: ${{ github.event.pull_request.base.ref }}
194-
body: ${{ github.event.pull_request.body }}
195-
draft: false
196-
197-
- run: |
198-
ls -al dist/
32+
set -euo pipefail
33+
[[ "$(cat artifacts/dist-version/VERSION)" == "0.23.0" ]]
34+
wheel_dirs=(artifacts/dist-wheels-*)
35+
[[ ${#wheel_dirs[@]} -eq 40 ]]
36+
mkdir dist
37+
cp artifacts/dist-sdist/uvloop-0.23.0.tar.gz dist/
38+
for wheel_dir in "${wheel_dirs[@]}"; do
39+
cp "$wheel_dir"/uvloop-0.23.0-*.whl dist/
40+
done
19941
20042
- name: Upload to PyPI
20143
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
20244
with:
45+
skip-existing: true
20346
verbose: true

0 commit comments

Comments
 (0)