Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin/bump on main merge #390

Merged
merged 5 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: bump
on:
pull_request:
types: [closed]
branches: [main]

jobs:
bump:
# make sure this job runs only when the PR is not a version bump PR and the pr is merged to main (not just closed)
if: github.event.pull_request.title != 'admin/version-bump' && github.event.pull_request.merged == true
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: write # Add this permission to allow pushing the version bump
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Setup PDM
uses: pdm-project/setup-pdm@v2
with:
python-version: "3.10"

- name: Install bumpversion
run: pip install bumpversion

- name: Configure Git
run: |
git config user.name github-actions
git config user.email [email protected]

- name: Delete remote branch # delete the branch if it exists
run: |
git push origin --delete admin/version-bump || true

- name: Apply bumpversion minor
run: |
git checkout -b admin/version-bump
bumpversion minor
git push origin admin/version-bump

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: admin/version-bump
title: admin/version-bump
body: "Automated version bump"
base: main
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
---
name: publish
on:
push:
pull_request:
types: [closed]
branches: [main]

jobs:
publish:
# only publish when the PR is a version bump PR and the pr is merged to main
if: github.event.pull_request.title == 'admin/version-bump' && github.event.pull_request.merged == true
runs-on: ubuntu-latest
environment: release
permissions:
Expand Down
Loading