Skip to content

Create Release

Create Release #16

name: Create Release
on:
push:
tags:
- "*" # Match any tag
workflow_dispatch:
inputs:
tag:
description: "Tag name to create release for"
required: true
default: ""
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 }}"