name: Release on: push: tags: - 'v*' jobs: build: name: Build release binaries strategy: fail-fast: false matrix: include: - target: linux/amd64 ext: tar.gz runs_on: ubuntu-latest - target: linux/arm64 ext: tar.gz runs_on: ubuntu-latest - target: linux/386 ext: tar.gz runs_on: ubuntu-latest - target: linux/arm ext: tar.gz runs_on: ubuntu-latest - target: windows/amd64 ext: zip runs_on: windows-latest - target: windows/386 ext: zip runs_on: windows-latest - target: windows/arm64 ext: zip runs_on: windows-latest - target: darwin/amd64 ext: tar.gz runs_on: macos-latest - target: darwin/arm64 ext: tar.gz runs_on: macos-latest runs-on: ${{ matrix.runs_on }} steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version: stable - name: Install zip via Chocolatey (PowerShell) if: runner.os == 'Windows' shell: pwsh run: | # Install the CLI choco install zip.commandline --no-progress -y # Load the helper module and refresh the environment $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Source)\..\.." Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" refreshenv # activates zip in current session - name: Build binary shell: bash run: | TARGET="${{ matrix.target }}" GOOS=$(echo "$TARGET" | cut -d'/' -f1) GOARCH=$(echo "$TARGET" | cut -d'/' -f2) BIN=eko EXT="" if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi mkdir -p dist env GOOS=$GOOS GOARCH=$GOARCH go build -o $BIN$EXT ./cmd/client ARCHIVE=dist/${BIN}-${GOARCH}-${GOOS}.${{ matrix.ext }} if [ "${{ matrix.ext }}" = "zip" ]; then zip -j $ARCHIVE $BIN$EXT else tar -czf $ARCHIVE $BIN$EXT fi shasum -a 256 $ARCHIVE > $ARCHIVE.sha256 - name: Upload release artifacts uses: softprops/action-gh-release@v2 with: token: ${{ secrets.EKO_RELEASE_TOKEN }} tag_name: ${{ github.ref_name }} files: dist/*