chore: automate post-release updates using ci (#538)

It just automates the post-release updates needed after every release, like documentation and installer script updates, as well as checksum generation.
This commit is contained in:
Jose Quintana
2025-04-10 01:09:08 +02:00
committed by GitHub
parent 934b0e2c40
commit 5d1eaac0b5

View File

@@ -3,12 +3,15 @@ on:
release:
types:
- published
permissions:
contents: write
pull-requests: write
jobs:
checksum_file:
release_updates:
runs-on: ubuntu-22.04
environment: release-updates-static-web-server
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -18,8 +21,9 @@ jobs:
- name: Prepare
shell: bash
run: |
echo "SERVER_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "version is: ${{ env.SERVER_VERSION }}"
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "version is: ${{ env.RELEASE_VERSION }}"
echo "PR_BRANCH_NAME=release-docs-${{ env.RELEASE_VERSION }}-$(date -u '+%d-%m-%Y')" >> $GITHUB_ENV
- name: Post release updates
shell: bash
@@ -29,17 +33,30 @@ jobs:
run: |
scripts/ci/post_release_updates.sh
- name: Commit post release updates changes
- name: Commit post release updates
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add scripts/installer.sh
git add docs/content/download-and-install.md
git add docs/content/download-and-install.template.md
git commit --verbose -m "docs: ${{ env.SERVER_VERSION }} [skip ci]"
git fetch origin
git rebase --strategy-option=theirs origin/master --verbose
git push --verbose
git commit --verbose -m "docs: ${{ env.RELEASE_VERSION }} [skip ci]"
git checkout -b ${{ env.PR_BRANCH_NAME }}
git push --set-upstream origin --verbose ${{ env.PR_BRANCH_NAME }}
- name: Create pull request for release updates
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--title "Post release ${{ env.RELEASE_VERSION }} updates" \
--body "An automated PR containing documentation and script installer updates corresponding to the current release \`${{ env.RELEASE_VERSION }}\`.\n\nSee https://static-web-server.net/download-and-install/ for more details." \
--base "master" \
--head "${{ env.PR_BRANCH_NAME }}" \
--label "v2" --label "enhancement" --label "documentation" --label "automated" \
--draft