Skip to content

fix: don't start metrics server in duckdb-service worker processes (#… #182

fix: don't start metrics server in duckdb-service worker processes (#…

fix: don't start metrics server in duckdb-service worker processes (#… #182

Workflow file for this run

name: Release Build
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-24.04-arm
goos: linux
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: |
SHORT_SHA=$(git rev-parse --short HEAD)
go build -ldflags "-X main.version=build-${SHORT_SHA} -X main.commit=${{ github.sha }} -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" -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: Generate checksums
run: |
cd artifacts
sha256sum duckgres-linux-amd64/duckgres-linux-amd64 duckgres-linux-arm64/duckgres-linux-arm64 | \
sed 's|duckgres-linux-\([^/]*\)/||g' > checksums.txt
cat checksums.txt
- name: Check if build release already exists
id: check-existing
run: |
TAG="build-${{ steps.sha.outputs.short }}"
if gh release view "$TAG" &>/dev/null; then
echo "Release $TAG already exists — skipping to avoid overwriting a promoted release"
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
if: steps.check-existing.outputs.exists == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: build-${{ steps.sha.outputs.short }}
name: Build ${{ steps.sha.outputs.short }}
prerelease: true
make_latest: false
body: |
Automated build from commit ${{ github.sha }}
To promote this build to customer ducklings: edit this release and uncheck "pre-release".
files: |
artifacts/duckgres-linux-amd64/duckgres-linux-amd64
artifacts/duckgres-linux-arm64/duckgres-linux-arm64
artifacts/checksums.txt
- 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
prerelease: true
make_latest: false
body: |
Latest build from commit ${{ github.sha }}
This is a **pre-release** (canary). It auto-deploys to dev and canary ducklings.
To promote a build to customer ducklings: find the specific `build-*` release and uncheck "pre-release".
files: |
artifacts/duckgres-linux-amd64/duckgres-linux-amd64
artifacts/duckgres-linux-arm64/duckgres-linux-arm64
artifacts/checksums.txt