Skip to content

Create Release

Create Release #56

Workflow file for this run

name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to tag and release'
required: true
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check if tag exists
run: |
if git rev-parse "v${{ github.event.inputs.version }}" >/dev/null 2>&1; then
echo "Tag v${{ github.event.inputs.version }} already exists"
exit 1
fi
- name: Create and push tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag -a "v${{ github.event.inputs.version }}" -m "Release v${{ github.event.inputs.version }}"
git push origin "v${{ github.event.inputs.version }}"
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
name: Release v${{ github.event.inputs.version }}
tag_name: v${{ github.event.inputs.version }}
generate_release_notes: true
make_latest: true