Skip to content

Commit 0eb7eb9

Browse files
committed
Add manual PyPI release retries
1 parent 4b2d17b commit 0eb7eb9

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build
22
on:
33
workflow_call:
4+
inputs:
5+
checkout_ref:
6+
description: Git ref containing the package sources to build
7+
required: false
8+
type: string
49

510
jobs:
611
# Build python wheels
@@ -26,6 +31,7 @@ jobs:
2631
with:
2732
fetch-depth: 0
2833
persist-credentials: false
34+
ref: ${{ inputs.checkout_ref || github.ref }}
2935
- uses: actions/setup-python@v6
3036
with:
3137
python-version: "3.12"
@@ -35,7 +41,7 @@ jobs:
3541
run: >-
3642
echo LIBCST_NO_LOCAL_SCHEME=1 >> $GITHUB_ENV
3743
- name: Enable building wheels for pre-release CPython versions
38-
if: github.event_name != 'release'
44+
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
3945
run: echo CIBW_ENABLE=cpython-prerelease >> $GITHUB_ENV
4046
- name: Build wheels
4147
uses: pypa/cibuildwheel@v4.0.0rc1

.github/workflows/pypi_upload.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@ on:
55
types: [published]
66
push:
77
branches: [main]
8+
workflow_dispatch:
9+
inputs:
10+
release_ref:
11+
description: Git tag or commit containing the release sources
12+
required: true
13+
type: string
814

915
permissions:
1016
contents: read
1117

1218
jobs:
1319
build:
1420
uses: Instagram/LibCST/.github/workflows/build.yml@main
21+
with:
22+
checkout_ref: ${{ inputs.release_ref || github.ref }}
1523
upload_release:
1624
name: Upload wheels to pypi
1725
runs-on: ubuntu-latest
@@ -23,6 +31,7 @@ jobs:
2331
with:
2432
fetch-depth: 0
2533
persist-credentials: false
34+
ref: ${{ inputs.release_ref || github.ref }}
2635
- name: Download binary wheels
2736
id: download
2837
uses: actions/download-artifact@v5
@@ -55,7 +64,7 @@ jobs:
5564
packages-dir: ${{ steps.download.outputs.download-path }}
5665
skip-existing: true
5766
- name: Publish distribution 📦 to PyPI
58-
if: github.event_name == 'release'
67+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
5968
uses: pypa/gh-action-pypi-publish@release/v1
6069
with:
6170
packages-dir: ${{ steps.download.outputs.download-path }}

0 commit comments

Comments
 (0)