Skip to content

Commit 93a22d1

Browse files
committed
CI: Backporting releases from PyPI to Github
1 parent 0772fa3 commit 93a22d1

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/backport.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Backport PyPI release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "PyPI version (for example 1.0)"
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
gh-release:
16+
runs-on: ubuntu-24.04
17+
env:
18+
PACKAGE: lain-upload
19+
VERSION: ${{ inputs.version }}
20+
21+
steps:
22+
- name: Download release files from PyPI
23+
run: |
24+
mkdir dist
25+
26+
curl -fsSL \
27+
"https://pypi.org/pypi/${PACKAGE}/${VERSION}/json" |
28+
jq -r '.urls[].url' |
29+
while read -r url; do
30+
curl -fsSL -O -J "$url" --output-dir dist
31+
done
32+
33+
- name: Create GitHub Release
34+
uses: softprops/action-gh-release@v3
35+
with:
36+
tag_name: v${{ inputs.version }}
37+
name: ${{ env.PACKAGE }} v${{ inputs.version }}
38+
files: dist/*
39+
generate_release_notes: true

0 commit comments

Comments
 (0)