mirror of
https://github.com/rangermix/TwitchDropsMiner.git
synced 2026-05-29 16:39:37 +00:00
refactor: consolidate version extraction logic and update workflow validation
Extracted version extraction logic from workflows into a centralized script for better reusability and consistency. Updated validation output naming for clarity. Changes: - Add extract_version.sh for centralized version extraction - Remove update_version.sh (functionality integrated into workflows) - Update validate_semver.sh output: release_type → is_prerelease - Refactor docker-release.yml to use extract_version.sh - Refactor github-release.yml to use centralized scripts - Add version duplication check in version-release.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
18
.github/workflows/version-release.yml
vendored
18
.github/workflows/version-release.yml
vendored
@@ -26,10 +26,18 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.PUBLISHER_TOKEN }}
|
||||
|
||||
- name: Configure Git
|
||||
- name: Validate version format
|
||||
id: validate
|
||||
run: .github/scripts/validate_semver.sh "${{ github.event.inputs.version }}"
|
||||
|
||||
- name: Check if input version
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
CURRENT_VERSION=$(grep -oP '(?<=__version__ = ")[^"]+' src/version.py)
|
||||
INPUT_VERSION="${{ github.event.inputs.version }}"
|
||||
if [ "$CURRENT_VERSION" = "$INPUT_VERSION" ]; then
|
||||
echo "Error: Input version '$INPUT_VERSION' is the same as the current version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check if branch exists
|
||||
run: |
|
||||
@@ -45,7 +53,11 @@ jobs:
|
||||
- name: Create release branch and update version
|
||||
run: |
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
VERSION="${{ steps.validate.outputs.version }}"
|
||||
|
||||
# Update version.py
|
||||
mv -f src/version.py src/last_version.py
|
||||
echo "__version__ = \"$VERSION\"" > src/version.py
|
||||
|
||||
Reference in New Issue
Block a user