2021-10-23 09:56:11 +00:00
|
|
|
name: Release milestone
|
2022-07-15 12:08:29 +00:00
|
|
|
description: Creates a release and tag out of a given milestone
|
2021-10-23 09:56:11 +00:00
|
|
|
inputs:
|
|
|
|
milestone:
|
|
|
|
description: Milestone for this release
|
|
|
|
required: true
|
|
|
|
github_token:
|
|
|
|
description: Secret GitHub token
|
|
|
|
required: true
|
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
steps:
|
|
|
|
- name: Setup node
|
2024-03-15 21:03:10 +00:00
|
|
|
uses: actions/setup-node@v4
|
2021-10-23 09:56:11 +00:00
|
|
|
with:
|
|
|
|
node-version: '16'
|
|
|
|
|
2023-01-28 10:58:45 +00:00
|
|
|
- name: Setup git
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
|
|
run: |
|
|
|
|
git config user.name "GitHub Actions Bot"
|
|
|
|
git config user.email "<>"
|
|
|
|
|
|
|
|
- name: Get current date
|
|
|
|
id: date
|
|
|
|
uses: Kaven-Universe/github-action-current-date-time@v1
|
|
|
|
with:
|
|
|
|
format: 'YYYY-MM-DD'
|
|
|
|
|
2024-09-14 23:23:35 +00:00
|
|
|
- name: Get current major version number
|
|
|
|
id: majorvers
|
2023-01-28 10:58:45 +00:00
|
|
|
uses: ashley-taylor/regex-property-action@v1
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
with:
|
|
|
|
value: ${{ env.MILESTONE }}
|
2024-09-14 23:23:35 +00:00
|
|
|
regex: (\d+)\.\d+\.\d+
|
2023-01-30 11:57:11 +00:00
|
|
|
replacement: "$1"
|
|
|
|
|
2024-09-14 23:23:35 +00:00
|
|
|
- name: Get current main version number
|
|
|
|
id: mainvers
|
2023-07-27 15:47:36 +00:00
|
|
|
uses: ashley-taylor/regex-property-action@v1
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
with:
|
|
|
|
value: ${{ env.MILESTONE }}
|
|
|
|
regex: (\d+)\.(\d+)\.\d+
|
2024-09-14 23:23:35 +00:00
|
|
|
replacement: "$1.$2"
|
2023-07-27 15:47:36 +00:00
|
|
|
|
2024-09-14 23:23:35 +00:00
|
|
|
- name: Get current main version number for anchoring
|
|
|
|
id: mainanchor
|
2023-01-30 11:57:11 +00:00
|
|
|
uses: ashley-taylor/regex-property-action@v1
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
with:
|
|
|
|
value: ${{ env.MILESTONE }}
|
2024-09-14 23:23:35 +00:00
|
|
|
regex: (\d+)\.(\d+)\.\d+
|
|
|
|
replacement: "$1$2"
|
2023-01-28 10:58:45 +00:00
|
|
|
|
|
|
|
- name: Get next version number
|
|
|
|
id: nextvers
|
|
|
|
uses: WyriHaximus/github-action-next-semvers@v1
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
with:
|
|
|
|
version: ${{ env.MILESTONE }}
|
|
|
|
|
2021-10-23 09:56:11 +00:00
|
|
|
- name: Close milestone
|
2023-05-27 22:16:26 +00:00
|
|
|
uses: Akkjon/close-milestone@v2.1.0
|
2023-01-30 15:54:17 +00:00
|
|
|
continue-on-error: true
|
2021-10-23 09:56:11 +00:00
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
2023-01-28 10:58:45 +00:00
|
|
|
with:
|
|
|
|
milestone_name: ${{ env.MILESTONE }}
|
2021-10-23 09:56:11 +00:00
|
|
|
|
2023-01-28 10:58:45 +00:00
|
|
|
- name: Create temporary tag
|
2021-10-23 09:56:11 +00:00
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
|
|
run: |
|
2023-01-30 11:57:11 +00:00
|
|
|
git tag --message "" "$MILESTONE" || true
|
|
|
|
git push origin "$MILESTONE" || true
|
|
|
|
git tag --force --message "" "$MILESTONE"
|
|
|
|
git push --force origin "$MILESTONE"
|
2021-10-23 09:56:11 +00:00
|
|
|
|
2024-09-14 23:23:35 +00:00
|
|
|
- name: Update releasenotes
|
2023-01-28 10:58:45 +00:00
|
|
|
uses: mingjun97/file-regex-replace@v1
|
|
|
|
with:
|
2024-09-14 23:23:35 +00:00
|
|
|
regex: '(.)[\n\r\s]*<!--GH-ACTION-RELEASE-MILESTONE-->[\n\r\s]*[\n\r]+##\s*.*?[\n\r][\n\r\s]*(.)'
|
|
|
|
replacement: "$1\n\n<!--GH-ACTION-RELEASE-MILESTONE-->\n\n## ${{ steps.mainvers.outputs.value }}.0 (${{ steps.date.outputs.time }}) {#${{ steps.mainanchor.outputs.value }}0}\n\n$2"
|
|
|
|
include: exampleSite/content/basics/releasenotes/${{ steps.majorvers.outputs.value }}.x/_index.en.md
|
2023-01-28 10:58:45 +00:00
|
|
|
|
|
|
|
- name: Update generator version
|
2021-10-23 09:56:11 +00:00
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
2023-01-28 10:58:45 +00:00
|
|
|
run: |
|
|
|
|
echo -n "$MILESTONE" > layouts/partials/version.txt
|
|
|
|
|
|
|
|
- name: Update changelog
|
|
|
|
shell: bash
|
|
|
|
env:
|
2021-10-23 09:56:11 +00:00
|
|
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
|
|
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
|
|
run: |
|
|
|
|
npx github-release-notes@0.17.1 changelog --generate --override --tags=all
|
2023-01-28 10:58:45 +00:00
|
|
|
|
|
|
|
- name: Commit updates
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
|
|
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
|
|
run: |
|
2021-10-23 09:56:11 +00:00
|
|
|
git add *
|
|
|
|
git commit --message "Ship tag $MILESTONE"
|
|
|
|
git push origin main
|
|
|
|
|
|
|
|
- name: Create final tag
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
2023-01-30 11:57:11 +00:00
|
|
|
MILESTONE_MINOR: ${{ steps.mainvers.outputs.value }}
|
|
|
|
MILESTONE_MAJOR: ${{ steps.majorvers.outputs.value }}
|
2021-10-23 09:56:11 +00:00
|
|
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
|
|
run: |
|
2023-01-30 11:57:11 +00:00
|
|
|
git tag --force --message "" "$MILESTONE"
|
2021-10-23 09:56:11 +00:00
|
|
|
git push --force origin "$MILESTONE"
|
2023-01-30 11:57:11 +00:00
|
|
|
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"
|
2023-02-05 12:01:49 +00:00
|
|
|
git tag --message "" "x" || true
|
|
|
|
git push origin "x" || true
|
|
|
|
git tag --force --message "" "x"
|
|
|
|
git push --force origin "x"
|
2021-10-23 09:56:11 +00:00
|
|
|
|
|
|
|
- name: Publish release
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
|
|
run: |
|
|
|
|
npx github-release-notes@0.17.1 release --tags "$MILESTONE"
|
2022-02-11 08:38:19 +00:00
|
|
|
|
|
|
|
- name: Update version number to mark non-release version
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
|
|
run: |
|
2022-07-15 12:07:48 +00:00
|
|
|
echo -n "$MILESTONE+tip" > layouts/partials/version.txt
|
2022-02-11 08:38:19 +00:00
|
|
|
git add *
|
2022-02-11 08:40:22 +00:00
|
|
|
git commit --message "Mark non-release version"
|
2022-02-11 08:38:19 +00:00
|
|
|
git push origin main
|
2022-07-15 12:08:29 +00:00
|
|
|
|
|
|
|
- name: Create next patch milestone
|
2023-01-04 00:19:49 +00:00
|
|
|
uses: WyriHaximus/github-action-create-milestone@v1
|
2023-01-30 15:54:17 +00:00
|
|
|
continue-on-error: true
|
2022-07-15 12:08:29 +00:00
|
|
|
env:
|
|
|
|
MILESTONE: ${{ inputs.milestone }}
|
|
|
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
2023-01-28 10:58:45 +00:00
|
|
|
with:
|
|
|
|
title: ${{ steps.nextvers.outputs.patch }}
|