Create Release Branch #46
This file contains 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
name: Create Release Branch | |
on: | |
workflow_dispatch: | |
inputs: | |
versionRelease: | |
description: 'Release version' | |
required: true | |
jobs: | |
createrelease: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Create release branch | |
run: git checkout -b release/${{ github.event.inputs.versionRelease }} | |
- name: Change files for release | |
run: | | |
./mkrelease.sh ${{ github.event.inputs.versionRelease }} | |
- name: Get date | |
id: date | |
run: echo "date=$(date -d 'now' +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Generate changelog | |
run: | | |
printf "## [${{ github.event.inputs.versionRelease }}](https://github.com/fvwmorg/fvwm3/tree/${{ github.event.inputs.versionRelease }}) (${{ env.date }})\n" >./tmp.out | |
curl \ | |
--silent \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/fvwmorg/fvwm3/releases/generate-notes \ | |
-d '{"tag_name":"${{ github.event.inputs.versionRelease }}","target_commitish":"main","configuration_file_path":".github/release.yml"}' | \ | |
jq -r '.body' >> ./tmp.out | |
sed -i '2d' ./tmp.out | |
sed -i "2r tmp.out" CHANGELOG.md | |
- name: Commit Changes | |
run: | | |
git config user.name "Thomas Adam" | |
git config user.email "[email protected]" | |
git commit -a --author="Thomas Adam <[email protected]>" -m "[AUTO]: release ${{ github.event.inputs.versionRelease }}" | |
git push -u origin HEAD | |
- name: Create pull request into main | |
uses: thomaseizinger/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
head: release/${{ github.event.inputs.versionRelease }} | |
base: main | |
title: release ${{ github.event.inputs.versionRelease }} | |
reviewers: ${{ github.event.issue.user.login }} | |
body: | | |
Hello, | |
This PR was created in response to a release workflow running. | |
I've updated the version name and code commit: ${{ steps.make-commit.outputs.commit }}. |