.github: Merge release and PyPI steps.

"on: release" only triggers for manual releases, not releases created by another workflow.

Fixes https://github.com/pybricks/support/issues/1558
This commit is contained in:
Laurens Valk
2024-04-05 11:11:08 +02:00
parent c05d5c42cd
commit b0ff867dcc
2 changed files with 18 additions and 18 deletions
-15
View File
@@ -1,15 +0,0 @@
name: Release to PyPI
on:
release:
types: [published]
jobs:
build_and_publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: pipx run poetry build
- run: pipx run poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
+18 -3
View File
@@ -3,16 +3,23 @@ on:
tags:
- 'v3.*'
name: Create release
name: Create release on GitHub and PyPI
permissions:
contents: write
jobs:
upload_release:
name: Upload Release Assets
create_release:
name: Create release on GitHub
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Get tag
run: echo "GITHUB_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -28,3 +35,11 @@ jobs:
--title="${tag#v}" \
-F CHANGELOG.md \
$PRERELEASE_FLAG
build_and_publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: pipx run poetry build
- run: pipx run poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}