Files
efremidze__swift-architectu…/.github/workflows/release.yml
2026-03-16 23:09:46 -07:00

54 lines
1.3 KiB
YAML

name: Release
on:
workflow_dispatch:
inputs:
bump:
description: 'Version bump (patch, minor, major)'
required: true
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure main branch
run: |
if [ "${GITHUB_REF}" != "refs/heads/main" ]; then
echo "Release workflow must run from main, got ${GITHUB_REF}"
exit 1
fi
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: main
default_bump: ${{ inputs.bump }}
tag_prefix: v
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
generate_release_notes: true