Skip to content

Commit 04baa04

Browse files
committed
Fix release workflow
1 parent 14f42c6 commit 04baa04

File tree

1 file changed

+37
-10
lines changed

1 file changed

+37
-10
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
required: false
1717
type: string
1818
default: ""
19+
mark_as_latest:
20+
description: "Mark this release as latest"
21+
required: false
22+
type: boolean
23+
default: true
1924

2025
permissions:
2126
contents: write
@@ -75,24 +80,25 @@ jobs:
7580
echo "Found CI run: $RUN_ID"
7681
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
7782
78-
- name: Create and push tag
83+
- name: Verify commit for tagging
7984
run: |
8085
git config user.name "github-actions[bot]"
8186
git config user.email "github-actions[bot]@users.noreply.github.com"
8287
83-
NOTES="${{ inputs.release_notes }}"
84-
if [ -z "$NOTES" ]; then
85-
NOTES="Release ${{ inputs.version }}"
86-
fi
87-
88-
git tag -a "${{ inputs.version }}" "${{ inputs.commit_sha }}" -m "$NOTES"
89-
git push origin "${{ inputs.version }}"
88+
# Verify commit exists and is in the repository
89+
git rev-parse --verify "${{ inputs.commit_sha }}"
90+
echo "Commit ${{ inputs.commit_sha }} verified for release"
9091
9192
create-release:
9293
name: Create GitHub Release
9394
runs-on: ubuntu-latest
9495
needs: validate-and-tag
9596
steps:
97+
- name: Checkout repository
98+
uses: actions/checkout@v3
99+
with:
100+
fetch-depth: 0
101+
96102
- name: Download Linux artifact
97103
uses: actions/download-artifact@v4
98104
with:
@@ -128,22 +134,43 @@ jobs:
128134
129135
CI_URL="https://github.com/${{ github.repository }}/actions/runs/${{ needs.validate-and-tag.outputs.run_id }}"
130136
137+
# Generate checksums
138+
cd release
139+
LINUX_CHECKSUM=$(sha256sum dabgent_mcp-linux-x86_64 | awk '{print $1}')
140+
MACOS_CHECKSUM=$(sha256sum dabgent_mcp-macos-arm64 | awk '{print $1}')
141+
cd ..
142+
131143
cat > release_notes.md <<EOF
132144
$NOTES
133145
146+
## SHA256 Checksums
147+
\`\`\`
148+
$LINUX_CHECKSUM dabgent_mcp-linux-x86_64
149+
$MACOS_CHECKSUM dabgent_mcp-macos-arm64
150+
\`\`\`
151+
134152
---
135-
**Build Verification:**
136153
- Built from commit: \`${{ inputs.commit_sha }}\`
137154
- CI Run: $CI_URL
138-
- Artifacts can be verified against the CI build
139155
EOF
140156
141157
gh release create "${{ inputs.version }}" \
142158
--repo "${{ github.repository }}" \
143159
--title "${{ inputs.version }}" \
144160
--notes-file release_notes.md \
161+
--target "${{ inputs.commit_sha }}" \
145162
release/*
146163
164+
- name: Mark as latest release
165+
if: ${{ inputs.mark_as_latest }}
166+
env:
167+
GH_TOKEN: ${{ github.token }}
168+
run: |
169+
# Mark this release as the latest
170+
gh release edit "${{ inputs.version }}" \
171+
--repo "${{ github.repository }}" \
172+
--latest
173+
147174
- name: Output release URL
148175
run: |
149176
echo "Release created successfully!"

0 commit comments

Comments
 (0)