Add message author id to ReactionAddEvent (#1289) #192
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
# Whenever a commit is pushed with a non-snapshot version (no "-SNAPSHOT" suffix), this job will create a new | |
# GitHub release. Additionally, it will increment the version by one patch level, append a "-SNAPSHOT" suffix, and | |
# commit + push it to release branch (e.g., "2.3.4" -> "2.3.5-SNAPSHOT") | |
# Automatically merge release PR | |
name: Release and Update | |
on: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- uses: gradle/gradle-build-action@v2 | |
- name: Read Version | |
id: read-version | |
run: | | |
version=`cat gradle.properties | sed -n "s/^.*version\s*=\s*\(\S*\).*$/\1/p"` | |
echo "::set-output name=version::$version" | |
- name: Generate Changelog | |
id: generate-changelog | |
run: | | |
changelog=`./gradlew generateChangelog` | |
echo "::set-output name=changelog::$changelog" | |
- name: Create Release | |
if: ${{ !endsWith(steps.read-version.outputs.version, 'SNAPSHOT') }} | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.read-version.outputs.version }} | |
release_name: v${{ steps.read-version.outputs.version }} | |
body: | | |
${{ steps.generate-changelog.outputs.changelog }} | |
draft: true | |
prerelease: false | |
- name: Update Release Version | |
if: ${{ !endsWith(steps.read-version.outputs.version, 'SNAPSHOT') }} | |
run: | | |
./gradlew test incrementVersion | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git checkout -b release-v${{ steps.read-version.outputs.version }} | |
git add gradle.properties | |
git commit -am "Increment patch version and append -SNAPSHOT suffix" | |
git push --set-upstream origin release-v${{ steps.read-version.outputs.version }} | |
- name: Create Release Pull Request | |
if: ${{ !endsWith(steps.read-version.outputs.version, 'SNAPSHOT') }} | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
commit-message: Add Release v${{ steps.read-version.outputs.version }} | |
committer: github-actions[bot] | |
author: 41898282+github-actions[bot]@users.noreply.github.com | |
signoff: false | |
branch: release-v${{ steps.read-version.outputs.version }} | |
base: master | |
delete-branch: true | |
title: 'Release v${{ steps.read-version.outputs.version }}' | |
body: | | |
Release report v${{ steps.read-version.outputs.version }} | |
- Auto-generated by [create-pull-request][1] | |
[1]: https://github.com/peter-evans/create-pull-request | |
labels: | | |
release | |
automated pr | |
assignees: Bastian | |
reviewers: Bastian | |
team-reviewers: | | |
owners | |
maintainers | |
draft: false | |
- name: Auto Approve Release Pull Request | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: juliangruber/approve-pull-request-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
number: ${{ steps.cpr.outputs.pull-request-number }} | |
- name: Enable Release Pull Request Automerge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v2 | |
with: | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: squash |