build: add moving version tags #453

This commit is contained in:
Sören Weber 2023-01-30 12:57:11 +01:00
parent 880029117d
commit 41e3d96a64
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
3 changed files with 31 additions and 6 deletions

View file

@ -37,7 +37,17 @@ runs:
with:
value: ${{ env.MILESTONE }}
regex: (\d+\.\d+)\.\d+
replacement: "$1.0"
replacement: "$1"
- name: Get current major version number
id: majorvers
uses: ashley-taylor/regex-property-action@v1
env:
MILESTONE: ${{ inputs.milestone }}
with:
value: ${{ env.MILESTONE }}
regex: (\d+)\.\d+\.\d+
replacement: "$1"
- name: Get next version number
id: nextvers
@ -61,14 +71,16 @@ runs:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
git tag --message "" "$MILESTONE"
git push origin "$MILESTONE"
git tag --message "" "$MILESTONE" || true
git push origin "$MILESTONE" || true
git tag --force --message "" "$MILESTONE"
git push --force origin "$MILESTONE"
- name: Update migration docs
uses: mingjun97/file-regex-replace@v1
with:
regex: '(.)[\n\r\s]*<!--GH-ACTION-RELEASE-MILESTONE-->[\n\r\s]*-*\s*[\n\r\s]*?[\n\r]+##\s*.*?[\n\r][\n\r\s]*(.)'
replacement: "$1\n\n<!--GH-ACTION-RELEASE-MILESTONE-->\n\n---\n\n## ${{ steps.mainvers.outputs.value }} (${{ steps.date.outputs.time }})\n\n$2"
replacement: "$1\n\n<!--GH-ACTION-RELEASE-MILESTONE-->\n\n---\n\n## ${{ steps.mainvers.outputs.value }}.0 (${{ steps.date.outputs.time }})\n\n$2"
include: exampleSite/content/basics/migration/_index.en.md
- name: Update generator version
@ -99,12 +111,23 @@ runs:
- name: Create final tag
shell: bash
continue-on-error: true
env:
MILESTONE: ${{ inputs.milestone }}
MILESTONE_MINOR: ${{ steps.mainvers.outputs.value }}
MILESTONE_MAJOR: ${{ steps.majorvers.outputs.value }}
GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
git tag --force --message "" "$MILESTONE"
git tag --force --message "" "$MILESTONE"
git push --force origin "$MILESTONE"
git tag --message "" "$MILESTONE_MINOR.x" || true
git push origin "$MILESTONE_MINOR.x" || true
git tag --force --message "" "$MILESTONE_MINOR.x"
git push --force origin "$MILESTONE_MINOR.x"
git tag --message "" "$MILESTONE_MAJOR.x" || true
git push origin "$MILESTONE_MAJOR.x" || true
git tag --force --message "" "$MILESTONE_MAJOR.x"
git push --force origin "$MILESTONE_MAJOR.x"
- name: Publish release
shell: bash

View file

@ -26,6 +26,8 @@ This document shows you what's new in the latest release. For a detailed list of
As a further advantage, the image inside the lightbox now has its own URL and is therefore linkable.
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} [GitHub releases](https://github.com/McShelby/hugo-theme-relearn/tags) are also now tagged for the main version (eg. `1.2.x`) and major version (eg. `1.x`) making it easier for you to pin the theme to a certain version.
---
## 5.10.0 (2023-01-25)

View file

@ -115,7 +115,7 @@ After a successful run of the action
- the version number for the `<meta generator>` is updated
- the updated files are commited
- the milestone is closed
- the repository is tagged with the version number
- the repository is tagged with the version number (eg. `1.2.3`), the main version number (eg. `1.2.x`) and the major version number (eg. `1.x`)
- a new entry in the [GitHub release list](https://github.com/McShelby/hugo-theme-relearn/releases) with the according changelog will be created
- the [official documentation](https://mcshelby.github.io/hugo-theme-relearn/index.html) is built and deployed
- the version number for the `<meta generator>` is updated to a temporary and commited (this helps to determine if users are running directly on the main branch or are using releases)