Skip to content

Commit 884018d

Browse files
Basudev Bharat BhushanBasudev Bharat Bhushan
authored andcommitted
workflow.yml update
1 parent 4861f79 commit 884018d

File tree

1 file changed

+37
-29
lines changed

1 file changed

+37
-29
lines changed

.github/workflows/workflow.yml

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,81 @@
1-
name: Python Package Release
1+
name: Upload Python Package
22

33
on:
44
push:
55
branches:
66
- master
7-
- main
87

98
permissions:
109
contents: write
11-
packages: write
1210
id-token: write
13-
pull-requests: write
11+
actions: write
12+
packages: write
1413

1514
jobs:
16-
prepare-release:
17-
if: github.ref == 'refs/heads/master'
15+
release:
1816
runs-on: ubuntu-latest
19-
2017
steps:
21-
- name: Checkout master
18+
- name: Checkout master branch
2219
uses: actions/checkout@v4
20+
with:
21+
ref: master
22+
fetch-depth: 0
23+
24+
# - name: Create and push to main
25+
# run: |
26+
# git checkout -b main
27+
# git push origin main
2328

24-
- name: Create release branch
29+
- name: Create and push to feature branch
2530
run: |
2631
git checkout -b release-main
2732
git push origin release-main
2833
29-
- name: Raise PR to main
34+
- name: Raise PR from release-main to main
3035
uses: peter-evans/create-pull-request@v5
3136
with:
3237
base: main
3338
head: release-main
34-
title: "Release PR: release-main main"
35-
body: "Auto-generated release PR for version bump"
36-
branch: pr-release-main
39+
title: "Automated Release PR: release-main -> main"
40+
body: "This PR contains the automated changes for the release process."
41+
branch: pr-release-main-to-main
3742

38-
publish-release:
39-
if: github.ref == 'refs/heads/main'
40-
runs-on: ubuntu-latest
41-
42-
steps:
43-
- name: Checkout main
44-
uses: actions/checkout@v4
43+
- name: Checkout release branch
44+
run: git checkout main
4545

4646
- name: Set up Python
47-
uses: actions/setup-python@v4
47+
uses: actions/setup-python@v3
4848
with:
4949
python-version: "3.x"
5050

5151
- name: Install dependencies
5252
run: |
53-
pip install --upgrade pip
53+
python -m pip install --upgrade pip
5454
pip install build twine python-semantic-release setuptools-scm
5555
56-
- name: Configure Git
56+
- name: Run semantic-release
57+
env:
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5759
run: |
5860
git config user.name github-actions
5961
git config user.email github-actions@github.com
60-
61-
- name: Run semantic-release publish
62-
env:
63-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64-
run: semantic-release publish
62+
semantic-release version
63+
semantic-release publish
6564
6665
- name: Build package
6766
run: python -m build
6867

69-
- name: Upload to PyPI
68+
- name: Publish package to PyPI
7069
env:
7170
TWINE_USERNAME: __token__
7271
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
7372
run: twine upload dist/*
73+
74+
- name: Raise PR from main to master
75+
uses: peter-evans/create-pull-request@v5
76+
with:
77+
base: master
78+
head: main
79+
title: "Release PR: main -> master"
80+
body: "This PR merges the changes from the main branch back into master after the release."
81+
branch: pr-main-to-master

0 commit comments

Comments
 (0)