Skip to content

Commit

Permalink
Add release GHA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
josiah-wolf-oberholtzer committed Mar 6, 2024
1 parent 926ce9e commit c5efdd3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
workflow_dispatch:

concurrency:
group: "${{ github.workflow }}"

jobs:
bump-version:
name: Bump version
environment: release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Get latest version
run: echo OLD_VERSION=$(gh release list -L 1 --json name | jq -r '.[0].name') >> $GITHUB_ENV
- name: Bump version file
run: python dev/bump-version.py ``
- name: Push changes
run: |
git add .
git commit -m "Bump version to ${NEW_VERSION}"
git push
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true
name: "${NEW_VERSION}"
tag_name: "v${NEW_VERSION}"
2 changes: 1 addition & 1 deletion dev/bump-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def run():
parsed_args = parser.parse_args()
year, month, beta = calculate_new_version_info(parsed_args.release)
rewrite_version_file(year, month, beta)
print(f"{year}.{month}b{beta}")
print(f"{year}.{month}b{beta}", end="")


if __name__ == "__main__":
Expand Down

0 comments on commit c5efdd3

Please sign in to comment.