Skip to content

1.0.92

1.0.92 #2

Workflow file for this run

name: Release
on:
release:
types: [released]
workflow_dispatch:
inputs:
TAG_NAME:
description: "Tag name"
required: true
env:
REGISTRY: ghcr.io
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
patch-changelog:
runs-on: ubuntu-latest
name: Patch CHANGELOG.md and update GitHub release notes
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set environment variables
run: |
echo GIT_BRANCH_NAME=mark-version-${TAG_NAME#v}-as-released >> $GITHUB_ENV
echo GIT_COMMIT_MESSAGE=Mark version ${TAG_NAME#v} as released >> $GITHUB_ENV
echo RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/${GITHUB_REPOSITORY}/releases/tags/${TAG_NAME} | jq '.id') >> $GITHUB_ENV
- name: Get changelog for this specific release and update release notes
run: |
gh api \
--method PATCH \
--header "Accept: application/vnd.github+json" \
/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID} \
-f body="$(./get-changelog.sh)"
- name: Checkout new branch and patch changelog
run: |
git checkout -b $GIT_BRANCH_NAME
sed -i "/^\#\# \[Unreleased\]$/a \\\n\#\# $TAG_NAME - $(date '+%Y-%m-%d')" CHANGELOG.md
- name: Commit, push and create pull request
run: |
git config --global user.email "office@geowerkstatt.ch"
git config --global user.name "GeoWerkstatt-Build"
git commit -am "$GIT_COMMIT_MESSAGE"
git push --set-upstream origin $GIT_BRANCH_NAME
gh pr create --title "$GIT_COMMIT_MESSAGE" --body ""