generated from CCBR/CCBR_NextflowTemplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update release actions from renee
- Loading branch information
1 parent
994971c
commit 0b22cdd
Showing
2 changed files
with
19 additions
and
3 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 |
---|---|---|
|
@@ -4,7 +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 commit history. | ||
description: | | ||
Semantic version tag for next release. | ||
If not provided, it will be determined based on conventional commit history. | ||
Example: v2.5.11 | ||
required: false | ||
type: string | ||
default: "" | ||
|
@@ -61,7 +64,10 @@ jobs: | |
semver_pattern = 'v(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?' | ||
next_semver = re.match(semver_pattern, next_version) | ||
if not next_semver: | ||
raise ValueError(f"Tag {next_version} does not match semantic versioning guidelines") | ||
extra_msg = '' | ||
if not next_version.startswith('v'): | ||
extra_msg = "The tag does not start with 'v'." | ||
raise ValueError(f"Tag {next_version} does not match semantic versioning guidelines. {extra_msg}\nView the guidelines here: https://semver.org/") | ||
# assert next version is only 1 greater than current | ||
current_semver = re.match(semver_pattern, current_version) | ||
|
@@ -109,7 +115,12 @@ jobs: | |
citation._implementation.cffobj['version'] = "${{ env.NEXT_VERSION }}" | ||
citation._implementation.cffobj['date-released'] = "${{ env.DATE }}" | ||
with open('CITATION.cff', 'w') as outfile: | ||
outfile.write(yaml.dump(citation._implementation.cffobj, sort_keys=False)) | ||
outfile.write(yaml.dump(citation._implementation.cffobj, sort_keys=False, indent=2)) | ||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --files CITATION.cff CHANGELOG.md VERSION | ||
continue-on-error: true | ||
|
||
- name: Commit & push to branch | ||
run: | | ||
|
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 |
---|---|---|
|
@@ -36,6 +36,11 @@ jobs: | |
with open('VERSION', 'w') as outfile: | ||
outfile.write(f"{version}-dev\n") | ||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --files CITATION.cff CHANGELOG.md VERSION | ||
continue-on-error: true | ||
|
||
- name: Open pull request | ||
run: | | ||
git add CHANGELOG.md VERSION | ||
|