Skip to content

Commit 2b5bd6d

Browse files
Basudev Bharat BhushanBasudev Bharat Bhushan
authored andcommitted
workflow.yml temp release update
1 parent 40a7adc commit 2b5bd6d

File tree

1 file changed

+36
-30
lines changed

1 file changed

+36
-30
lines changed

.github/workflows/workflow.yml

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,73 @@
1-
name: Upload Python Package
1+
name: Python Package Release
22

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

89
permissions:
910
contents: write
10-
id-token: write
11-
actions: write
1211
packages: write
12+
id-token: write
13+
pull-requests: write
1314

1415
jobs:
15-
release:
16+
prepare-release:
17+
if: github.ref == 'refs/heads/master'
1618
runs-on: ubuntu-latest
19+
1720
steps:
18-
- name: Checkout master branch
21+
- name: Checkout master
1922
uses: actions/checkout@v4
20-
with:
21-
ref: master
22-
fetch-depth: 0
2323

24-
- name: Create and push to main
24+
- name: Create release branch
2525
run: |
26-
git checkout -b main
27-
git push origin main
26+
git checkout -b release-main
27+
git push origin release-main
28+
29+
- name: Raise PR to main
30+
uses: peter-evans/create-pull-request@v5
31+
with:
32+
base: main
33+
head: release-main
34+
title: "Release PR: release-main → main"
35+
body: "Auto-generated release PR for version bump"
36+
branch: pr-release-main
2837

29-
- name: Checkout release branch
30-
run: git checkout main
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
3145

3246
- name: Set up Python
33-
uses: actions/setup-python@v3
47+
uses: actions/setup-python@v4
3448
with:
3549
python-version: "3.x"
3650

3751
- name: Install dependencies
3852
run: |
39-
python -m pip install --upgrade pip
53+
pip install --upgrade pip
4054
pip install build twine python-semantic-release setuptools-scm
4155
42-
- name: Run semantic-release
43-
env:
44-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Configure Git
4557
run: |
4658
git config user.name github-actions
4759
git config user.email github-actions@github.com
48-
semantic-release version
49-
semantic-release publish
60+
61+
- name: Run semantic-release publish
62+
env:
63+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
run: semantic-release publish
5065

5166
- name: Build package
5267
run: python -m build
5368

54-
- name: Publish package to PyPI
69+
- name: Upload to PyPI
5570
env:
5671
TWINE_USERNAME: __token__
5772
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
5873
run: twine upload dist/*
59-
60-
- name: Raise PR from main to master
61-
uses: peter-evans/create-pull-request@v5
62-
with:
63-
base: master
64-
head: main
65-
title: "Release PR: main -> master"
66-
body: "This PR merges the changes from the main branch back into master after the release."
67-
branch: pr-main-to-master

0 commit comments

Comments
 (0)