@@ -28,112 +28,6 @@ jobs:
2828 config-file : .github/release-please-${{ github.ref_name }}.json
2929 target-branch : ${{ github.ref_name }}
3030
31- auto-tag :
32- needs : [release-please]
33- if : ${{ startsWith(github.ref, 'refs/heads/v') }}
34- runs-on : ubuntu-latest
35- permissions :
36- contents : write
37- steps :
38- - name : Checkout repository
39- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
40- with :
41- fetch-depth : 0
42- token : ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
43-
44- - name : Configure Git
45- run : |
46- git config --global user.name AztecBot
47- git config --global user.email tech@aztecprotocol.com
48-
49- - name : Extract version from branch name
50- id : version
51- run : |
52- BRANCH_NAME="${GITHUB_REF#refs/heads/}"
53- MAJOR_VERSION="${BRANCH_NAME#v}"
54- echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
55- echo "major=$MAJOR_VERSION" >> $GITHUB_OUTPUT
56-
57- - name : Determine next version
58- id : next_version
59- run : |
60- # Read current version from release-please manifest and use it directly
61- if [ ! -f .release-please-manifest.json ]; then
62- echo "Error: .release-please-manifest.json not found"
63- exit 1
64- fi
65-
66- MANIFEST_VERSION=$(jq -r '."."' .release-please-manifest.json)
67- echo "Manifest version: $MANIFEST_VERSION"
68-
69- # Ensure manifest major matches vX branch major
70- BRANCH_MAJOR="${{ steps.version.outputs.major }}"
71- if [ -z "$BRANCH_MAJOR" ]; then
72- echo "Error: Branch major version not available from previous step"
73- exit 1
74- fi
75-
76- MANIFEST_MAJOR="${MANIFEST_VERSION%%.*}"
77- if [ "$MANIFEST_MAJOR" != "$BRANCH_MAJOR" ]; then
78- echo "Error: Manifest major ($MANIFEST_MAJOR) does not match branch major ($BRANCH_MAJOR)"
79- exit 1
80- fi
81-
82- # Accept stable versions (X.Y.Z) and prerelease versions (X.Y.Z-suffix.N)
83- if [[ "$MANIFEST_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z0-9.]+)?$ ]]; then
84- NEXT_VERSION="$MANIFEST_VERSION"
85- else
86- echo "Error: Invalid manifest version format: $MANIFEST_VERSION"
87- echo "Expected: X.Y.Z or X.Y.Z-prerelease.N"
88- exit 1
89- fi
90-
91- echo "version=$NEXT_VERSION" >> $GITHUB_OUTPUT
92- echo "Next version will be: $NEXT_VERSION"
93-
94- - name : Get next RC number
95- id : rc
96- run : |
97- # Get all existing RC tags for this specific version
98- EXISTING_TAGS=$(git tag -l "v${{ steps.next_version.outputs.version }}-rc.*" | sort -V)
99-
100- if [ -z "$EXISTING_TAGS" ]; then
101- # No RC tags exist yet for this version, start with 1
102- NEXT_RC=1
103- else
104- # Extract the highest RC number and increment
105- LAST_TAG=$(echo "$EXISTING_TAGS" | tail -n 1)
106- LAST_RC=$(echo "$LAST_TAG" | sed 's/.*-rc\.\([0-9]\+\)$/\1/')
107- NEXT_RC=$((LAST_RC + 1))
108- fi
109-
110- echo "number=$NEXT_RC" >> $GITHUB_OUTPUT
111- echo "Next RC number: $NEXT_RC"
112-
113- - name : Check if commit already tagged
114- id : check_tag
115- run : |
116- # Check if current commit already has any RC tag
117- EXISTING_TAGS=$(git tag --points-at HEAD | grep "^v.*-rc\." || true)
118-
119- if [ -n "$EXISTING_TAGS" ]; then
120- echo "Commit already tagged as: $EXISTING_TAGS"
121- echo "skip=true" >> $GITHUB_OUTPUT
122- else
123- echo "skip=false" >> $GITHUB_OUTPUT
124- fi
125-
126- - name : Create and push new RC tag
127- if : steps.check_tag.outputs.skip != 'true'
128- run : |
129- TAG_NAME="v${{ steps.next_version.outputs.version }}-rc.${{ steps.rc.outputs.number }}"
130-
131- # Create annotated tag
132- git tag -a "$TAG_NAME" -m "Release candidate ${{ steps.rc.outputs.number }} for v${{ steps.next_version.outputs.version }}"
133- git push origin "$TAG_NAME"
134-
135- echo "✅ Created tag: $TAG_NAME"
136-
13731 dedupe-release-notes :
13832 name : Deduplicate release notes
13933 needs : [release-please]
0 commit comments