|
9 | 9 | env: |
10 | 10 | CARGO_TERM_COLOR: always |
11 | 11 | REGISTRY: ghcr.io |
12 | | - IMAGE_NAME: joostvdg/git-next-tag-rust |
| 12 | + IMAGE_NAME: joostvdg/git-next-tag-rustasd |
| 13 | + |
13 | 14 |
|
14 | 15 | jobs: |
15 | 16 | test: |
@@ -158,6 +159,43 @@ jobs: |
158 | 159 | echo "patch=$PATCH" >> $GITHUB_OUTPUT |
159 | 160 | echo "Generated version: $NEW_VERSION" |
160 | 161 |
|
| 162 | + build-artifacts: |
| 163 | + runs-on: ubuntu-latest |
| 164 | + needs: [generate-version] |
| 165 | + outputs: |
| 166 | + version: ${{ needs.generate-version.outputs.version }} |
| 167 | + steps: |
| 168 | + - uses: actions/checkout@v4 |
| 169 | + with: |
| 170 | + fetch-depth: 0 |
| 171 | + |
| 172 | + - name: Install cross |
| 173 | + run: cargo install cross |
| 174 | + |
| 175 | + - name: Build Linux AMD64 |
| 176 | + run: cross build --release --target x86_64-unknown-linux-gnu |
| 177 | + |
| 178 | + - name: Build Windows AMD64 |
| 179 | + run: cross build --release --target x86_64-pc-windows-gnu |
| 180 | + |
| 181 | + - name: Build Mac ARM64 |
| 182 | + run: cross build --release --target aarch64-apple-darwin |
| 183 | + |
| 184 | + - name: Prepare artifacts |
| 185 | + run: | |
| 186 | + mkdir -p dist |
| 187 | + cp target/x86_64-unknown-linux-gnu/release/git-next-tag-rust dist/git-next-tag-rust-linux-amd64 |
| 188 | + cp target/x86_64-pc-windows-gnu/release/git-next-tag-rust.exe dist/git-next-tag-rust-windows-amd64.exe |
| 189 | + cp target/aarch64-apple-darwin/release/git-next-tag-rust dist/git-next-tag-rust-macos-arm64 |
| 190 | + cd dist |
| 191 | + sha256sum * > checksums.txt |
| 192 | +
|
| 193 | + - name: Upload build artifacts |
| 194 | + uses: actions/upload-artifact@v4 |
| 195 | + with: |
| 196 | + name: cli-binaries |
| 197 | + path: dist/ |
| 198 | + |
161 | 199 | build-and-push: |
162 | 200 | needs: [scans, test, security-scan, generate-version] |
163 | 201 | runs-on: ubuntu-latest |
@@ -280,3 +318,36 @@ jobs: |
280 | 318 | draft: false |
281 | 319 | prerelease: false |
282 | 320 |
|
| 321 | + - name: Download build artifacts |
| 322 | + uses: actions/download-artifact@v4 |
| 323 | + with: |
| 324 | + name: cli-binaries |
| 325 | + path: dist/ |
| 326 | + |
| 327 | + - name: Create GitHub release |
| 328 | + uses: actions/create-release@v1 |
| 329 | + env: |
| 330 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 331 | + with: |
| 332 | + tag_name: v${{ needs.generate-version.outputs.version }} |
| 333 | + release_name: Release v${{ needs.generate-version.outputs.version }} |
| 334 | + body: | |
| 335 | + ## Changes |
| 336 | + - Automated release v${{ needs.generate-version.outputs.version }} |
| 337 | +
|
| 338 | + ## Container Image |
| 339 | + - `${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.generate-version.outputs.version }}` |
| 340 | + - `${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build-and-push.outputs.image-digest }}` |
| 341 | +
|
| 342 | + draft: false |
| 343 | + prerelease: false |
| 344 | + |
| 345 | + - name: Upload release assets |
| 346 | + uses: softprops/action-gh-release@v1 |
| 347 | + with: |
| 348 | + tag_name: v${{ needs.generate-version.outputs.version }} |
| 349 | + files: | |
| 350 | + dist/git-next-tag-rust-linux-amd64 |
| 351 | + dist/git-next-tag-rust-windows-amd64.exe |
| 352 | + dist/git-next-tag-rust-macos-arm64 |
| 353 | + dist/checksums.txt |
0 commit comments