Skip to content

Commit b2c5ee3

Browse files
committed
chore: adjust the pypi release workflow to use gh cli
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 8c0fd22 commit b2c5ee3

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/pypi-release.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
name: Build Python distributions, publish on PyPI, and create a GH release
1+
name: Build Python distributions, publish on PyPI, and create a GitHub release
22

33
on:
44
workflow_dispatch:
55
push:
66
tags:
77
- "v*.*.*"
88

9+
env:
10+
PYPI_PROJECT_URL: "https://pypi.org/p/django-altcha"
11+
912
jobs:
1013
build-python-dist:
1114
name: Build Python distributions
@@ -14,7 +17,7 @@ jobs:
1417
contents: read
1518

1619
steps:
17-
- name: Checkout
20+
- name: Checkout repository
1821
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1922
with:
2023
persist-credentials: false # do not keep the token around
@@ -48,7 +51,7 @@ jobs:
4851
runs-on: ubuntu-24.04
4952
environment:
5053
name: pypi
51-
url: https://pypi.org/p/django-altcha
54+
url: ${{ env.PYPI_PROJECT_URL }}
5255
permissions:
5356
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
5457

@@ -71,15 +74,18 @@ jobs:
7174
contents: write
7275

7376
steps:
77+
- name: Checkout repository
78+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
79+
with:
80+
persist-credentials: false
81+
7482
- name: Download package distributions
7583
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
7684
with:
7785
name: python-package-distributions
7886
path: dist/
7987

80-
- name: Create GH release
81-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
82-
with:
83-
draft: false
84-
generate_release_notes: true
85-
files: dist/*
88+
- name: Create GitHub release
89+
run: gh release create "$GITHUB_REF_NAME" dist/* --generate-notes
90+
env:
91+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/run-unit-tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: Run unit tests
22

33
on:
4-
push:
5-
branches: [ main ]
4+
workflow_dispatch:
65
pull_request:
7-
branches: [ main ]
6+
push:
7+
branches:
8+
- main
89

910
jobs:
1011
test:

0 commit comments

Comments
 (0)