Skip to content

Commit

Permalink
Added create-release workflow for GitHub releases.
Browse files Browse the repository at this point in the history
  • Loading branch information
coltonbh committed Dec 20, 2024
1 parent 100ea71 commit f64f53f
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/create-release.yaml
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 }}"

0 comments on commit f64f53f

Please sign in to comment.