Use latest localstack for tests #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: prepare-release | |
| on: | |
| push: | |
| branches: | |
| - 'release/*' | |
| jobs: | |
| prepare-release: | |
| name: Prepare Release Commit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract version from branch name | |
| id: extract_version | |
| run: | | |
| BRANCH_NAME="${{ github.ref_name }}" | |
| echo "Branch name: $BRANCH_NAME" | |
| if [[ ! "$BRANCH_NAME" =~ ^release/([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then | |
| echo "Error: Branch name must be in format 'release/x.y.z' (e.g., 'release/3.5.0')" | |
| exit 1 | |
| fi | |
| VERSION="${BASH_REMATCH[1]}" | |
| echo "Extracted version: $VERSION" | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Configure Git | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| - name: Check if prepare release commit already exists | |
| id: check_commit | |
| run: | | |
| VERSION="${{ steps.extract_version.outputs.version }}" | |
| # Check if a prepare release commit for this version already exists | |
| if git log --oneline --grep="^Prepare for $VERSION release$" --max-count=1 | grep -q "Prepare for $VERSION release"; then | |
| echo "Found existing 'Prepare for $VERSION release' commit in branch history" | |
| echo "already_prepared=true" >> $GITHUB_OUTPUT | |
| # Also check if this specific version already exists in CHANGELOG | |
| elif grep -q "^Version $VERSION " CHANGELOG 2>/dev/null; then | |
| echo "Version $VERSION already exists in CHANGELOG" | |
| echo "already_prepared=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "No prepare for $VERSION release commit found, proceeding with release preparation" | |
| echo "already_prepared=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Run prepare release script | |
| if: steps.check_commit.outputs.already_prepared == 'false' | |
| run: | | |
| ./.github/scripts/prepare-release.sh "${{ steps.extract_version.outputs.version }}" | |
| - name: Create prepare for release commit | |
| if: steps.check_commit.outputs.already_prepared == 'false' | |
| run: | | |
| git add VERSION CHANGELOG README.md cmd/constants.go | |
| git commit -m "Prepare for ${{ steps.extract_version.outputs.version }} release" | |
| git push origin ${{ github.ref_name }} | |
| - name: Skip commit creation | |
| if: steps.check_commit.outputs.already_prepared == 'true' | |
| run: | | |
| echo "Skipping commit creation - prepare for release commit already exists" |