Skip to content

Commit d4a99f0

Browse files
committed
Use one workflow to publish and release
1 parent e938b85 commit d4a99f0

File tree

3 files changed

+21
-40
lines changed

3 files changed

+21
-40
lines changed

.github/RELEASE-TEMPLATE.md

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

.github/workflows/publish.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
name: Publish package to PyPI
1+
name: Publish package to PyPI and create release
22

33
on:
4-
release:
5-
types:
6-
- published
4+
push:
5+
branches: [master, kiota/long-term-branch]
6+
tags:
7+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
78

89
jobs:
910
build:
@@ -12,6 +13,7 @@ jobs:
1213
publish:
1314
name: Publish distribution to PyPI
1415
runs-on: ubuntu-latest
16+
if: startsWith(github.ref, 'refs/tags/v')
1517
environment: pypi_prod
1618
needs: [build]
1719
steps:
@@ -33,4 +35,19 @@ jobs:
3335
user: __token__
3436
password: ${{ secrets.PYPI_TOKEN }}
3537

38+
release:
39+
name: Create release
40+
runs-on: ubuntu-latest
41+
needs: [publish]
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
- name: Extract release notes
46+
id: extract-release-notes
47+
uses: ffurrer2/extract-release-notes@v1
48+
- name: Create release
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
run: gh release create --notes '${{ steps.extract-release-notes.outputs.release_notes }}' --title ${{ github.ref_name }} ${{ github.ref_name }}
52+
3653

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)