mirror of
https://github.com/rangermix/TwitchDropsMiner.git
synced 2026-05-26 07:08:04 +00:00
- Add dual-mode version extraction supporting branch and file validation - Implement comprehensive semver range validation (caret, tilde, wildcards) - Extract release creation logic to dedicated script for reusability - Add test suite with comprehensive coverage for validation scripts - Update workflow to validate new version is greater than current - Bump version to 1.1.0 in pyproject.toml to match version.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: Create Version Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Release version (SemVer format, e.g., 1.2.3 or 2.0.0-rc.1)'
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
CURRENT_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
|
|
|
jobs:
|
|
create-release-branch:
|
|
name: Create Release Branch
|
|
runs-on: ubuntu-latest
|
|
environment: prod
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5
|
|
with:
|
|
token: ${{ secrets.PUBLISHER_TOKEN }}
|
|
|
|
- name: Extract version
|
|
id: extract
|
|
run: .github/scripts/extract_version.sh
|
|
|
|
- name: Validate version format and range
|
|
id: validate
|
|
run: .github/scripts/validate_semver.sh "${{ github.event.inputs.version }}" ">${{ steps.extract.outputs.version }}"
|
|
|
|
- name: Check if branch exists
|
|
run: |
|
|
BRANCH_NAME="release/${{ steps.validate.outputs.version }}"
|
|
|
|
if git ls-remote --heads origin "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
|
|
echo "Error: Branch '$BRANCH_NAME' already exists"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Branch '$BRANCH_NAME' does not exist, proceeding..."
|
|
|
|
- name: Create release branch and update version
|
|
run: .github/scripts/create_release.sh "${{ steps.validate.outputs.version }}" "$CURRENT_BRANCH_NAME"
|