-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1392 from fbenke-pik/workflow
Automatically assign development version
- Loading branch information
Showing
3 changed files
with
62 additions
and
1 deletion.
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,16 @@ | ||
mode: ContinuousDelivery | ||
assembly-versioning-format: '{Major}.{Minor}.{Patch}.dev{CommitsSinceVersionSource}' | ||
branches: | ||
develop: | ||
regex: ^dev(elop)?(ment)?$ | ||
mode: ContinuousDeployment | ||
tag: dev | ||
increment: None | ||
prevent-increment-of-merged-branch-version: false | ||
track-merge-target: true | ||
source-branches: [] | ||
tracks-release-branches: true | ||
is-release-branch: false | ||
is-mainline: false | ||
pre-release-weight: 0 | ||
|
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,45 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
types: [ closed ] | ||
name: auto-dev-version | ||
|
||
jobs: | ||
auto-dev-version: | ||
if: github.repository == 'remindmodel/remind' && github.event.pull_request.merged == true | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.AUTO_DEV_VERSION_REMIND }} | ||
|
||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.x' | ||
|
||
- name: Determine Version | ||
id: gitversion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
configFilePath: .github/GitVersion.yml | ||
|
||
- name: Update CITATION.cff and config/default.cfg with version and date | ||
run: | | ||
sed -i 's/^version:.*$/version: "${{ steps.gitversion.outputs.assemblySemVer }}"/' CITATION.cff | ||
sed -i "s/^date-released:.*$/date-released: $(date --iso)/" CITATION.cff | ||
sed -i 's/^cfg$model_version <-.*$/cfg$model_version <- "${{ steps.gitversion.outputs.assemblySemVer }}"/' config/default.cfg | ||
- name: Commit changes to CITATION.cff | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: '["CITATION.cff", "config/default.cfg"]' | ||
author_name: REMIND Research Software Engineering | ||
author_email: [email protected] | ||
message: 'Release development version ${{ steps.gitversion.outputs.assemblySemVer }}' | ||
tag: 'v${{ steps.gitversion.outputs.assemblySemVer }}' | ||
pathspec_error_handling: exitImmediately |
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