-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added create-release workflow for GitHub releases.
- Loading branch information
Showing
1 changed file
with
44 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,44 @@ | ||
name: Create Release | ||
|
||
on: | ||
# Trigger on pushes after running this for past releases | ||
# push: | ||
# tags: | ||
# - "*" # Match any tag | ||
workflow_dispatch: # Manual trigger for release creation | ||
inputs: | ||
tag: | ||
description: "The tag to create a release for" | ||
required: true | ||
|
||
jobs: | ||
create-release: | ||
name: Create GitHub Release | ||
runs-on: ubuntu-latest | ||
environment: release # Link to the protected environment | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Extract Release Notes | ||
id: extract_notes | ||
run: | | ||
VERSION=${{ github.event.inputs.tag }} | ||
sed -n "/## \\[$VERSION\\]/,/## \\[/p" CHANGELOG.md | sed '$d' | sed "s/## \\[$VERSION\\]/## $VERSION/" > RELEASE_NOTES.md | ||
- name: Create GitHub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.event.inputs.tag }} | ||
release_name: Release ${{ github.event.inputs.tag }} | ||
body_path: ./RELEASE_NOTES.md | ||
draft: false | ||
prerelease: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Output release URL | ||
run: | | ||
echo "Release URL: ${{ steps.create_release.outputs.html_url }}" |