|
16 | 16 | required: false |
17 | 17 | type: string |
18 | 18 | default: "" |
| 19 | + mark_as_latest: |
| 20 | + description: "Mark this release as latest" |
| 21 | + required: false |
| 22 | + type: boolean |
| 23 | + default: true |
19 | 24 |
|
20 | 25 | permissions: |
21 | 26 | contents: write |
@@ -75,24 +80,25 @@ jobs: |
75 | 80 | echo "Found CI run: $RUN_ID" |
76 | 81 | echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT |
77 | 82 |
|
78 | | - - name: Create and push tag |
| 83 | + - name: Verify commit for tagging |
79 | 84 | run: | |
80 | 85 | git config user.name "github-actions[bot]" |
81 | 86 | git config user.email "github-actions[bot]@users.noreply.github.com" |
82 | 87 |
|
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" |
90 | 91 |
|
91 | 92 | create-release: |
92 | 93 | name: Create GitHub Release |
93 | 94 | runs-on: ubuntu-latest |
94 | 95 | needs: validate-and-tag |
95 | 96 | steps: |
| 97 | + - name: Checkout repository |
| 98 | + uses: actions/checkout@v3 |
| 99 | + with: |
| 100 | + fetch-depth: 0 |
| 101 | + |
96 | 102 | - name: Download Linux artifact |
97 | 103 | uses: actions/download-artifact@v4 |
98 | 104 | with: |
@@ -128,22 +134,43 @@ jobs: |
128 | 134 |
|
129 | 135 | CI_URL="https://github.com/${{ github.repository }}/actions/runs/${{ needs.validate-and-tag.outputs.run_id }}" |
130 | 136 |
|
| 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 | +
|
131 | 143 | cat > release_notes.md <<EOF |
132 | 144 | $NOTES |
133 | 145 |
|
| 146 | + ## SHA256 Checksums |
| 147 | + \`\`\` |
| 148 | + $LINUX_CHECKSUM dabgent_mcp-linux-x86_64 |
| 149 | + $MACOS_CHECKSUM dabgent_mcp-macos-arm64 |
| 150 | + \`\`\` |
| 151 | +
|
134 | 152 | --- |
135 | | - **Build Verification:** |
136 | 153 | - Built from commit: \`${{ inputs.commit_sha }}\` |
137 | 154 | - CI Run: $CI_URL |
138 | | - - Artifacts can be verified against the CI build |
139 | 155 | EOF |
140 | 156 |
|
141 | 157 | gh release create "${{ inputs.version }}" \ |
142 | 158 | --repo "${{ github.repository }}" \ |
143 | 159 | --title "${{ inputs.version }}" \ |
144 | 160 | --notes-file release_notes.md \ |
| 161 | + --target "${{ inputs.commit_sha }}" \ |
145 | 162 | release/* |
146 | 163 |
|
| 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 | +
|
147 | 174 | - name: Output release URL |
148 | 175 | run: | |
149 | 176 | echo "Release created successfully!" |
|
0 commit comments