-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benjamin Morris
committed
Jun 28, 2024
1 parent
e8cda95
commit 93029ae
Showing
2 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,29 @@ | ||
--- | ||
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: | ||
id-token: write | ||
contents: write # Add this permission to allow pushing the version bump | ||
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: Apply bumpversion minor | ||
run: | | ||
git checkout -b version-bump | ||
bumpversion minor | ||
git push origin 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 | ||
delete-branch: true | ||
|
||
- name: Build package | ||
run: pdm build | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
uses: pypa/gh-action-pypi-publish@release/v1 |