-
Notifications
You must be signed in to change notification settings - Fork 63
Improvement: Automate the creation of a version tag on a monthly basis #2031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
a85fef1
Automate the creation of a version tag on a monthly basis
Davknapp 64c7de6
test
Davknapp b972dee
fix push command
Davknapp f4d82c0
update token and checkout-action
Davknapp 83b6edd
update token
Davknapp fa06673
update name of the job
Davknapp 32e33e0
create branch and tag in one command
Davknapp 7be34e4
update a comment
Davknapp e70a471
checkout the main branch
Davknapp 6750417
test
Davknapp 3a1a299
delete content specification
Davknapp ea47e20
test push
Davknapp e0d3386
another test
Davknapp d3bdfe5
fix usage of create pr
Davknapp b6f07bd
test
Davknapp 21682ca
replace explicit version naming
Davknapp a92745c
avoid duplicate authorization
Davknapp 47bbfca
manage authorization
Davknapp 95d2016
test
Davknapp e7c6469
we actually don't need to create a new branch for a tag
Davknapp 5b1b41f
dont trigger on push
Davknapp 6ebceeb
add license statement
Davknapp 508509f
try automated extraction of the latest version
Davknapp 7f07e4b
update comment
Davknapp 812293d
Moved and renamed file
Davknapp 9ad639b
Merge remote-tracking branch 'origin/main' into rolling-release
Davknapp eff4b6c
Trigger on PR for tests
Davknapp 7e5440f
Use envariables to create the name of the new tag.
Davknapp 546f35d
fix autofill type
Davknapp 0b03002
fix debug output
Davknapp 759ec5f
use env vars
Davknapp fcff52c
try to fix debug output
Davknapp 70c6e1f
remove test trigger
Davknapp 527d311
Update .github/workflows/create_version_tag.yml
Davknapp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,77 @@ | ||
| name: Create a new version tag | ||
|
|
||
| # This file is part of t8code. | ||
| # t8code is a C library to manage a collection (a forest) of multiple | ||
| # connected adaptive space-trees of general element types in parallel. | ||
| # | ||
| # Copyright (C) 2025 the developers | ||
| # | ||
| # t8code is free software; you can redistribute it and/or modify | ||
| # it under the terms of the GNU General Public License as published by | ||
| # the Free Software Foundation; either version 2 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # t8code is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with t8code; if not, write to the Free Software Foundation, Inc., | ||
| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| # trigger at 0:00 on the first day of each month | ||
| - cron: '0 0 1 * *' | ||
|
|
||
| jobs: | ||
| monthly_release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| #checkout main branch | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: main | ||
| persist-credentials: false | ||
| # Get the current version from the latest tag | ||
| - name: Get latest tag | ||
| id: get_latest_tag | ||
| run: | | ||
| LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
| echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV | ||
| echo "LATEST_TAG=$LATEST_TAG" | ||
| # Get Major, Minor, Patch version numbers | ||
| - name: Parse version numbers | ||
| id: parse_version | ||
| run: | | ||
| VERSION_REGEX="v([0-9]+)\\.([0-9]+)\\.([0-9]+)" | ||
| if [[ "${{ env.LATEST_TAG }}" =~ $VERSION_REGEX ]]; then | ||
| MAJOR="${BASH_REMATCH[1]}" | ||
| MINOR="${BASH_REMATCH[2]}" | ||
| PATCH="${BASH_REMATCH[3]}" | ||
| echo "MAJOR=$MAJOR" >> $GITHUB_ENV | ||
| echo "MINOR=$MINOR" >> $GITHUB_ENV | ||
| echo "PATCH=$PATCH" >> $GITHUB_ENV | ||
| echo "MAJOR=$MAJOR, MINOR=$MINOR, PATCH=$PATCH" | ||
| else | ||
| echo "No valid tag found, aborting." | ||
| exit 1 | ||
| fi | ||
| # Create version name accessible in the following steps | ||
| - name: Set version name | ||
| run: | | ||
| echo "VERSION_NAME=v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}-$(date +'%Y.%m.%d')" >> $GITHUB_ENV | ||
| echo "VERSION_NAME=$VERSION_NAME" | ||
| # Create a new version tag | ||
| - name: Create version tag | ||
| run: | | ||
| git config user.email "t8ddy.bot@gmail.com" | ||
| git config user.name "t8ddy" | ||
| # configure remote to use the secret token for pushing | ||
| git remote set-url origin https://x-access-token:${{ secrets.T8DDY_TOKEN }}@github.com/${{ github.repository }} | ||
| git tag "${{ env.VERSION_NAME }}" | ||
| git push origin --tags | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.