Skip to content

Commit 28ebb58

Browse files
committed
add automatic release
1 parent 79be953 commit 28ebb58

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

.github/workflows/pypi.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,39 @@ name: Upload Python Package
1111
on:
1212
release:
1313
types: [published]
14+
pull_request:
15+
types:
16+
- closed
1417

1518
jobs:
19+
create-github-release:
20+
if: github.event.pull_request.merged == true
21+
runs-on: ubuntu-latest
22+
permissions: write-all
23+
steps:
24+
- name: Check out code
25+
uses: actions/checkout@v3
26+
27+
- name: Extract version from prismacloud/cli/version.py
28+
run: |
29+
version=$(grep 'version = ' prismacloud/api/version.py | sed -E "s/version = \"([^\"]+)\"/\1/")
30+
echo "PRISMA_CLOUD_API_VERSION=$version" >> $GITHUB_ENV
31+
32+
- name: Create GitHub Release
33+
run: |
34+
gh release create ${{ env.PRISMA_CLOUD_API_VERSION }} --generate-notes --latest
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
1638
deploy:
1739
runs-on: ubuntu-latest
40+
needs:
41+
- create-github-release
1842

1943
steps:
2044
- uses: actions/checkout@v3
2145
- name: Set up Python
22-
uses: actions/setup-python@v3
46+
uses: actions/setup-python@v4
2347
with:
2448
python-version: '3.9'
2549
- name: Install Dependencies

prismacloud/api/version.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
""" version file """
2-
3-
version = '5.2.9'
1+
version = "5.2.9"

0 commit comments

Comments
 (0)