v3.0.22 #107
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| release: | |
| types: [ released ] | |
| jobs: | |
| binary: | |
| name: Build and Release Binaries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Go Environment | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '^1.25.0' | |
| - name: Build Binaries | |
| run: | | |
| mkdir -p builds/compressed | |
| go install github.com/mitchellh/gox@latest | |
| cd cmd/dss | |
| gox --output "../../builds/dss-{{.OS}}-{{.Arch}}" -ldflags '-s -w' -osarch 'darwin/amd64 darwin/arm64 linux/amd64 linux/arm freebsd/amd64 windows/amd64' | |
| cd ../../builds | |
| find . -maxdepth 1 -type f -execdir zip 'compressed/{}.zip' '{}' \; | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: builds/compressed/*.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| setup: | |
| name: Setup Build Metadata | |
| runs-on: ubuntu-latest | |
| outputs: | |
| image_id: ${{ steps.setenv.outputs.image_id }} | |
| cache_tags: ${{ steps.setenv.outputs.cache_tags }} | |
| tags: ${{ steps.setenv.outputs.tags }} | |
| tags_latest: ${{ steps.setenv.outputs.tags_latest }} | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - id: setenv | |
| run: | | |
| IMAGE_ID=${GITHUB_REPOSITORY,,} | |
| TAG_NAME="${{ github.ref_name }}" | |
| # Support both specific version (from release tag) and latest | |
| TAGS="ghcr.io/${IMAGE_ID}:${TAG_NAME}" | |
| TAGS_LATEST="ghcr.io/${IMAGE_ID}:latest" | |
| CACHE_TAGS="ghcr.io/${IMAGE_ID}:buildcache" | |
| echo "image_id=$IMAGE_ID" >> $GITHUB_OUTPUT | |
| echo "tags=$TAGS" >> $GITHUB_OUTPUT | |
| echo "tags_latest=$TAGS_LATEST" >> $GITHUB_OUTPUT | |
| echo "cache_tags=$CACHE_TAGS" >> $GITHUB_OUTPUT | |
| build-amd64: | |
| name: Build amd64 image | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| install: true | |
| driver-opts: | | |
| network=host | |
| - name: Build amd64 image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| push: true | |
| platforms: linux/amd64 | |
| tags: ghcr.io/${{ needs.setup.outputs.image_id }}:amd64 | |
| cache-from: type=registry,ref=${{ needs.setup.outputs.cache_tags }} | |
| cache-to: type=registry,ref=${{ needs.setup.outputs.cache_tags }},mode=max | |
| build-args: | | |
| GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
| build-arm64: | |
| name: Build arm64 image | |
| runs-on: ubuntu-24.04-arm | |
| needs: setup | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| install: true | |
| driver-opts: | | |
| network=host | |
| - name: Build arm64 image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| push: true | |
| platforms: linux/arm64 | |
| tags: ghcr.io/${{ needs.setup.outputs.image_id }}:arm64 | |
| cache-from: type=registry,ref=${{ needs.setup.outputs.cache_tags }} | |
| cache-to: type=registry,ref=${{ needs.setup.outputs.cache_tags }},mode=max | |
| build-args: | | |
| GITHUB_TOKEN=${{ secrets.GH_ACCESS_TOKEN }} | |
| merge: | |
| name: Merge multi-arch image | |
| runs-on: ubuntu-latest | |
| needs: [ setup, build-amd64, build-arm64 ] | |
| outputs: | |
| image_tag: ${{ needs.setup.outputs.tags }} | |
| steps: | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get tag values | |
| run: | | |
| echo "Image ID: ${{ needs.setup.outputs.image_id }}" | |
| echo "Tags: ${{ needs.setup.outputs.tags }}" | |
| echo "Tags Latest: ${{ needs.setup.outputs.tags_latest }}" | |
| - name: Create and push multi-arch manifest | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ${{ needs.setup.outputs.tags }} \ | |
| -t ${{ needs.setup.outputs.tags_latest }} \ | |
| ghcr.io/${{ needs.setup.outputs.image_id }}:amd64 \ | |
| ghcr.io/${{ needs.setup.outputs.image_id }}:arm64 | |
| - name: Verify manifest | |
| run: | | |
| docker buildx imagetools inspect ${{ needs.setup.outputs.tags }} |