From f7c66e1f527a05732b5aa698301ffeb347da6e14 Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 9 Dec 2025 21:37:26 -0800 Subject: [PATCH 1/3] Add release workflow for ARM and x86 builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a GitHub Actions workflow that triggers on each push to main and: - Builds binaries for linux-amd64, linux-arm64, darwin-amd64, darwin-arm64 - Creates a GitHub release with all binaries tagged by commit SHA 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/release.yml | 81 +++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d519a6db --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,81 @@ +name: Release Build + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + build: + strategy: + matrix: + include: + - os: ubuntu-latest + goos: linux + goarch: amd64 + - os: ubuntu-latest + goos: linux + goarch: arm64 + - os: macos-latest + goos: darwin + goarch: amd64 + - os: macos-latest + goos: darwin + goarch: arm64 + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Build + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + run: | + go build -o duckgres-${{ matrix.goos }}-${{ matrix.goarch }} . + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: duckgres-${{ matrix.goos }}-${{ matrix.goarch }} + path: duckgres-${{ matrix.goos }}-${{ matrix.goarch }} + + release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Get short SHA + id: sha + run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: build-${{ steps.sha.outputs.short }} + name: Build ${{ steps.sha.outputs.short }} + body: | + Automated build from commit ${{ github.sha }} + files: | + artifacts/duckgres-linux-amd64/duckgres-linux-amd64 + artifacts/duckgres-linux-arm64/duckgres-linux-arm64 + artifacts/duckgres-darwin-amd64/duckgres-darwin-amd64 + artifacts/duckgres-darwin-arm64/duckgres-darwin-arm64 From 06287e1b11a0c953f586ec2a57c21a4faaac1800 Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 9 Dec 2025 21:39:37 -0800 Subject: [PATCH 2/3] Remove macOS builds from release workflow --- .github/workflows/release.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d519a6db..0f2514d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,12 +19,6 @@ jobs: - os: ubuntu-latest goos: linux goarch: arm64 - - os: macos-latest - goos: darwin - goarch: amd64 - - os: macos-latest - goos: darwin - goarch: arm64 runs-on: ${{ matrix.os }} @@ -77,5 +71,3 @@ jobs: files: | artifacts/duckgres-linux-amd64/duckgres-linux-amd64 artifacts/duckgres-linux-arm64/duckgres-linux-arm64 - artifacts/duckgres-darwin-amd64/duckgres-darwin-amd64 - artifacts/duckgres-darwin-arm64/duckgres-darwin-arm64 From f12374d221e971514bfceaaf518d4c9a7a88498c Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 9 Dec 2025 21:41:32 -0800 Subject: [PATCH 3/3] Add stable 'latest' release tag --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f2514d9..18b71854 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,3 +71,30 @@ jobs: files: | artifacts/duckgres-linux-amd64/duckgres-linux-amd64 artifacts/duckgres-linux-arm64/duckgres-linux-arm64 + + - name: Delete existing latest release + run: gh release delete latest --yes || true + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update latest tag + run: | + git tag -f latest + git push -f origin latest + + - name: Create latest release + uses: softprops/action-gh-release@v2 + with: + tag_name: latest + name: Latest Build + body: | + Latest build from commit ${{ github.sha }} + + For a stable URL, use: + ``` + https://github.com/PostHog/duckgres/releases/latest/download/duckgres-linux-amd64 + https://github.com/PostHog/duckgres/releases/latest/download/duckgres-linux-arm64 + ``` + files: | + artifacts/duckgres-linux-amd64/duckgres-linux-amd64 + artifacts/duckgres-linux-arm64/duckgres-linux-arm64