Skip to content

Create Release PR

Create Release PR #57

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Release preparation **
#
# This workflow create 2 pull requests branching from develop into:
# - master
# - develop
#
# The pull request contains:
# - Bump release version -> .env
# - New release tag
#
name: Create Release PR
on:
workflow_dispatch:
jobs:
createRelease_01:
name: Create Pull Request to master
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Calculate new version
id: calculate_version
run: |
chmod +x bin/next_version.sh
new_version=$(bin/next_version.sh | cut -d'=' -f2)
echo "new version: $new_version"
echo "new_version=$new_version" >> $GITHUB_ENV
# The changes here will be overwritten, however we need changes, else the PR will be automatically closed by GitHub
- name: Dummy Changes to keep PR open
run: |
echo "Dummy Change" >> .env
- name: Create Pull Request to master branch
id: cpr-main
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Prepare release v${{ env.new_version }}"
committer: Catrobot <[email protected]>
title: 'Release v${{ env.new_version }}" into master'
body: |
### Release v${{ env.new_version }}"
Release ToDo List:
- [X] Bump our version code
- [X] Create new Release/Tag on GitHub
This pull request is autogenerated using GitHub Actions.
For more information checkout the action '.github/workflows/create_release_pull_request.yaml'
labels: automated, new-release, master
branch: release/v${{ env.new_version }}"
delete-branch: true
reviewers: dmetzner
base: master
createRelease_02:
name: Create Pull Request to develop
runs-on: ubuntu-latest
needs: createRelease_01
steps:
- uses: actions/checkout@v4
- name: Set Version Code
run: |
sed -i -E "s/APP_VERSION='[0-9]+\.[0-9]+\.[0-9]+'/APP_VERSION='${{ env.new_version }}'/" .env
- name: Commit changes
run: |
git config --global user.name "Catrobot"
git config --global user.email "[email protected]"
git commit -am "Bump version to ${{ env.new_version }}"
- name: Create Pull Request to develop branch
id: cpr-develop
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Prepare release v${{ env.new_version }}
committer: Catrobot <[email protected]>
title: 'Release v${{ env.new_version }} into develop'
body: |
### Release v${{ env.new_version }}
Release ToDo List:
- [X] Bump our version code
- [X] Create new Release/Tag on GitHub
This pull request is autogenerated using GitHub Actions.
For more information checkout the action '.github/workflows/create_release_pull_request.yaml'
labels: automated, new-release
branch: release/v${{ env.new_version }}
delete-branch: true
reviewers: dmetzner
base: develop
createReleaseTag:
name: Create GitHub Release v${{ env.new_version }}

Check failure on line 103 in .github/workflows/create_release_pull_request.yaml

View workflow run for this annotation

GitHub Actions / Create Release PR

Invalid workflow file

The workflow is not valid. .github/workflows/create_release_pull_request.yaml (Line: 103, Col: 11): Unrecognized named-value: 'env'. Located at position 1 within expression: env.new_version
runs-on: ubuntu-latest
needs: [createRelease_01, createRelease_02]
steps:
- uses: actions/checkout@v4
- name: Checkout Release Branch
run: git checkout release/v${{ env.new_version }}
- name: Generate Release Notes
id: generate_notes
run: |
notes=$(git log --pretty=format:"* %s" `git describe --tags --abbrev=0`..HEAD)
echo "release_notes=$notes" >> $GITHUB_ENV
echo "::set-output name=release_notes::$notes"
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ env.new_version }} --target release/v${{ env.new_version }} -t "v${{ env.new_version }}" -n "${{ env.release_notes }}"