Skip to content

Commit 86c1a46

Browse files
CopilotfriggeriCopilot
authored
Add Go submodule version tags for reproducible builds (github#33)
* Initial plan * Add Go SDK submodule version tags to publish workflow Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com> * Add error handling for Go submodule tag creation Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com> * Add git fetch and error handling to Go tag step Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com> * Add conditional to Go tag step for clarity Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com> * Add robust tag existence check and creation verification Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com> * Simplify Go tag creation logic Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com> * Update .github/workflows/publish.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/publish.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com> Co-authored-by: Adrien Friggeri <adrien@friggeri.net> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ac0e763 commit 86c1a46

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,20 @@ jobs:
205205
--target ${{ github.sha }}
206206
env:
207207
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208+
- name: Tag Go SDK submodule
209+
if: github.event.inputs.dist-tag == 'latest' || github.event.inputs.dist-tag == 'prerelease'
210+
run: |
211+
set -e
212+
git config user.name "github-actions[bot]"
213+
git config user.email "github-actions[bot]@users.noreply.github.com"
214+
git fetch --tags
215+
TAG_NAME="go/v${{ needs.version.outputs.version }}"
216+
# Try to create the tag - will fail if it already exists
217+
if git tag "$TAG_NAME" ${{ github.sha }} 2>/dev/null; then
218+
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git "$TAG_NAME"
219+
echo "Created and pushed tag $TAG_NAME"
220+
else
221+
echo "Tag $TAG_NAME already exists, skipping"
222+
fi
223+
env:
224+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)