Skip to content

Commit

Permalink
ci: update release workflows from RENEE
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Jan 22, 2024
1 parent 2edef08 commit 7a954eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ on:
workflow_dispatch:
inputs:
version_tag:
description: Semantic version tag for next release. If not provided, it will be determined based on conventional commmit history.
description: Semantic version tag for next release. If not provided, it will be determined based on conventional commit history.
required: false
type: string
default: ''
push:
branches:
- release-draft
default: ""

env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -25,8 +22,8 @@ jobs:
fetch-depth: 0 # required to include tags
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
python-version: "3.11"
cache: "pip"
- run: pip install cffconvert>=2.0.0 pyyaml

- name: Get Date
Expand Down Expand Up @@ -70,8 +67,7 @@ jobs:
current_semver = re.match(semver_pattern, current_version)
groups = ['major', 'minor', 'patch']
greater = sum([next_semver.group(grp) > current_semver.group(grp) for grp in groups])
equal = sum([next_semver.group(grp) == current_semver.group(grp) for grp in groups])
if not (greater == 1 and equal == 2):
if not (greater == 1):
raise ValueError(f"Next version must only increment one number at a time. Current version: {current_version}. Proposed next version: {next_version}")
- name: Get release notes, update changelog & version file
Expand All @@ -92,7 +88,7 @@ jobs:
for_next = False
changelog_lines.append(line)
if for_next:
if for_next and next_version not in line:
next_release_lines.append(line)
with open(".github/latest-release.md", "w") as outfile:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ jobs:
git push --set-upstream origin ${{ env.BRANCH }}
gh pr create \
--fill-first
--fill-first \
--reviewer ${{ github.event.release.author.login }}
- name: Clean up release-draft branch
run: |
git push origin --delete release-draft || echo "No release-draft branch to delete"

0 comments on commit 7a954eb

Please sign in to comment.