Skip to content

feat(segkit): add Nix flake and declare as plugin dependency (#68) #62

feat(segkit): add Nix flake and declare as plugin dependency (#68)

feat(segkit): add Nix flake and declare as plugin dependency (#68) #62

Workflow file for this run

name: Create Release
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-release:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
is_release: ${{ steps.check.outputs.is_release }}
tags: ${{ steps.check.outputs.tags }}
first_tag: ${{ steps.check.outputs.first_tag }}
title: ${{ steps.check.outputs.title }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check for version bump commit
id: check
run: |
MSG=$(git log -1 --format=%s)
if echo "$MSG" | grep -qE '^chore\(release\):'; then
echo "is_release=true" >> "$GITHUB_OUTPUT"
TAGS=$(echo "$MSG" | grep -oE '[a-z][-a-z]*/v[0-9]+\.[0-9]+\.[0-9]+')
echo "tags<<EOF" >> "$GITHUB_OUTPUT"
echo "$TAGS" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
FIRST_TAG=$(echo "$TAGS" | head -1)
echo "first_tag=$FIRST_TAG" >> "$GITHUB_OUTPUT"
TITLE=$(echo "$MSG" | sed 's/^chore(release): //')
echo "title=$TITLE" >> "$GITHUB_OUTPUT"
BODY=$(git log -1 --format=%b)
echo "body<<EOF" >> "$GITHUB_OUTPUT"
echo "$BODY" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
else
echo "is_release=false" >> "$GITHUB_OUTPUT"
fi
- name: Create git tags
if: steps.check.outputs.is_release == 'true' && steps.check.outputs.tags != ''
run: |
echo "${{ steps.check.outputs.tags }}" | while read -r TAG; do
[ -z "$TAG" ] && continue
echo "Creating tag: $TAG"
git tag "$TAG"
git push origin "$TAG"
done
- name: Create GitHub Release
if: steps.check.outputs.is_release == 'true' && steps.check.outputs.first_tag != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ steps.check.outputs.first_tag }}" \
--title "${{ steps.check.outputs.title }}" \
--notes "${{ steps.check.outputs.body }}"