-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nikola Forró <[email protected]>
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Create a GitHub release once a release PR is merged | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
if_merged: | ||
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') && github.repository_owner == 'packit' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Create GitHub release | ||
run: | | ||
VERSION=$(grep -oP '^# \K[0-9.]+([.\-_]?[a-zA-Z0-9.\-_]+)?' CHANGELOG.md | head -n 1) | ||
# Take the lines between the first two headers from CHANGELOG.md, | ||
# and use it as a description for the new release. | ||
CHANGELOG=$(awk 'BEGIN { first = 0 } /^# / { if (first == 0) { first = 1 } else { exit } } /^[^#]/ { print $0 }' CHANGELOG.md) | ||
# Use the changelog re-calculated to create a new release | ||
gh release create ${VERSION} --draft --title ${VERSION} -n "${CHANGELOG}" | ||
env: | ||
GH_TOKEN: ${{ secrets.RELEASEBOT_GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Prepare a new release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
required: true | ||
description: Version number for the new release | ||
|
||
jobs: | ||
prepare-release: | ||
# To not run in forks | ||
if: github.repository_owner == 'packit' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Prepare release content | ||
uses: packit/prepare-release@v3 | ||
with: | ||
version: ${{ inputs.version }} | ||
specfiles: | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
labels: release | ||
commit-message: Release ${{ inputs.version }} | ||
title: Release ${{ inputs.version }} | ||
body: Update the changelog for release ${{ inputs.version }}. | ||
delete-branch: true |
Empty file.