Skip to content

Commit b0ff867

Browse files
committed
.github: Merge release and PyPI steps.
"on: release" only triggers for manual releases, not releases created by another workflow. Fixes pybricks/support#1558
1 parent c05d5c4 commit b0ff867

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

.github/workflows/release-to-pypi.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,23 @@ on:
33
tags:
44
- 'v3.*'
55

6-
name: Create release
6+
name: Create release on GitHub and PyPI
77

88
permissions:
99
contents: write
1010

1111
jobs:
12-
upload_release:
13-
name: Upload Release Assets
12+
create_release:
13+
name: Create release on GitHub
1414
runs-on: ubuntu-22.04
1515
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
with:
19+
submodules: true
20+
fetch-depth: 0
21+
- name: Get tag
22+
run: echo "GITHUB_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV
1623
- name: Create release
1724
env:
1825
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -28,3 +35,11 @@ jobs:
2835
--title="${tag#v}" \
2936
-F CHANGELOG.md \
3037
$PRERELEASE_FLAG
38+
build_and_publish:
39+
runs-on: ubuntu-22.04
40+
steps:
41+
- uses: actions/checkout@v3
42+
- run: pipx run poetry build
43+
- run: pipx run poetry publish
44+
env:
45+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)