Create Release #13
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 | |
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 }}" |