Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

ci: version every build on main, publish self-hosting from the tag

Carl-Gerhard Lindesvärd658673fc8539
diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml
deleted file mode 100644
index 70a216c1e..000000000
--- a/.github/workflows/cli-release.yml
+++ /dev/null
@@ -1,94 +0,0 @@
-name: CLI release
-
-# Pushing a `cli-vX.Y.Z` tag builds the self-hosting CLI for every platform and
-# attaches the binaries plus a checksums.txt to a GitHub release. The install
-# script and `openpanel upgrade` both verify those checksums before replacing
-# anything, so the asset names below are a contract with self-hosting/install.sh
-# and self-hosting/cli/src/self-update.ts.
-on:
- push:
- tags:
- - "cli-v*"
-
-permissions:
- contents: write
-
-jobs:
- build:
- strategy:
- matrix:
- include:
- - { target: linux-x64, runner: ubuntu-latest, smoke: true }
- - { target: linux-arm64, runner: ubuntu-latest, smoke: false }
- # macOS binaries are built and signed on macOS: an unsigned binary is
- # killed on launch on Apple Silicon.
- - { target: darwin-arm64, runner: macos-latest, smoke: true }
- - { target: darwin-x64, runner: macos-latest, smoke: false }
- runs-on: ${{ matrix.runner }}
- defaults:
- run:
- working-directory: self-hosting/cli
- steps:
- - uses: actions/checkout@v4
-
- - uses: oven-sh/setup-bun@v2
- with:
- bun-version-file: ".bun-version"
-
- - run: bun install --frozen-lockfile
-
- - run: bun test
-
- # The tag is the release's only version label, but the binary reports the
- # one in package.json; a mismatch would make `upgrade` loop forever.
- - name: Check the tag matches package.json
- run: |
- tag="${GITHUB_REF_NAME#cli-v}"
- version="$(bun -p "require('./package.json').version")"
- if [ "$tag" != "$version" ]; then
- echo "Tag says $tag but package.json says $version" >&2
- exit 1
- fi
-
- - name: Build
- run: bun build --compile --target="bun-${{ matrix.target }}" src/main.ts --outfile "dist/openpanel-${{ matrix.target }}"
-
- - name: Sign (ad hoc)
- if: runner.os == 'macOS'
- run: |
- codesign --force --sign - "dist/openpanel-${{ matrix.target }}"
- codesign --verify --verbose "dist/openpanel-${{ matrix.target }}"
-
- # Only where the runner can execute the target natively.
- - name: Smoke test
- if: matrix.smoke
- run: |
- test "$("./dist/openpanel-${{ matrix.target }}" --version)" = "${GITHUB_REF_NAME#cli-v}"
-
- - uses: actions/upload-artifact@v4
- with:
- name: openpanel-${{ matrix.target }}
- path: self-hosting/cli/dist/openpanel-${{ matrix.target }}
- if-no-files-found: error
-
- release:
- needs: build
- runs-on: ubuntu-latest
- steps:
- - uses: actions/download-artifact@v4
- with:
- path: dist
- pattern: openpanel-*
- merge-multiple: true
-
- - name: Checksums
- working-directory: dist
- run: |
- chmod +x openpanel-*
- sha256sum openpanel-* > checksums.txt
- cat checksums.txt
-
- - name: Publish the release
- env:
- GH_TOKEN: ${{ github.token }}
- run: gh release create "$GITHUB_REF_NAME" dist/openpanel-* dist/checksums.txt --repo "$GITHUB_REPOSITORY" --generate-notes --title "CLI ${GITHUB_REF_NAME#cli-v}"
diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml
index ad7a8d059..064ad758d 100644
--- a/.github/workflows/docker-build.yml
+++ b/.github/workflows/docker-build.yml
@@ -3,6 +3,10 @@ name: Docker Build and Push
on:
workflow_dispatch:
push:
+ # Branches only: the self-hosting tag has its own workflow, and the v* tags
+ # this workflow pushes must not start another build.
+ branches:
+ - "**"
paths-ignore:
# README and docs
- "**/README*"
@@ -140,11 +144,27 @@ jobs:
- name: Run tests
run: bun run test
+ # Debounce for main: a push within a minute of the previous one cancels its
+ # wait, so a burst of merges is built and versioned once, as its newest
+ # commit. `[release now]` in the pushed commit, or a manual run, skips the wait.
+ settle:
+ if: github.ref == 'refs/heads/main'
+ runs-on: ubuntu-latest
+ concurrency:
+ group: main-settle
+ cancel-in-progress: true
+ steps:
+ - name: Wait for a quiet minute
+ if: github.event_name == 'push' && !contains(github.event.head_commit.message, '[release now]')
+ run: sleep 60
+
build-api:
permissions:
packages: write
contents: read
- needs: lint-and-test
+ needs: [lint-and-test, settle]
+ # settle is skipped on other branches; a cancelled settle (debounced) stops the run.
+ if: ${{ !cancelled() && needs.lint-and-test.result == 'success' && contains(fromJSON('["success","skipped"]'), needs.settle.result) }}
strategy:
fail-fast: false
matrix:
@@ -207,6 +227,8 @@ jobs:
packages: read
contents: read
needs: [build-api, build-dashboard]
+ # Explicit, because a skipped settle earlier in the chain would otherwise skip this.
+ if: ${{ !cancelled() && needs.build-api.result == 'success' && needs.build-dashboard.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -252,8 +274,9 @@ jobs:
merge-api:
permissions:
packages: write
- contents: write
+ contents: read
needs: [build-api, smoke]
+ if: ${{ !cancelled() && needs.build-api.result == 'success' && needs.smoke.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -291,28 +314,12 @@ jobs:
-t ghcr.io/${{ env.repo_owner }}/api:${{ steps.tags.outputs.branch_name }}-${{ steps.tags.outputs.short_sha }} \
$(printf 'ghcr.io/${{ env.repo_owner }}/api@sha256:%s ' *)
- - name: Create/Update API tag
- if: github.ref == 'refs/heads/main'
- run: |
- # Delete existing tag if it exists
- if git tag -l "api" | grep -q "api"; then
- git tag -d "api"
- echo "Deleted local tag: api"
- fi
-
- # Create new tag
- git tag "api" "${{ github.sha }}"
- echo "Created tag: api"
-
- # Push tag to remote
- git push origin "api" --force
- echo "Pushed tag: api"
-
build-dashboard:
permissions:
packages: write
contents: read
- needs: lint-and-test
+ needs: [lint-and-test, settle]
+ if: ${{ !cancelled() && needs.lint-and-test.result == 'success' && contains(fromJSON('["success","skipped"]'), needs.settle.result) }}
strategy:
fail-fast: false
matrix:
@@ -371,8 +378,9 @@ jobs:
merge-dashboard:
permissions:
packages: write
- contents: write
+ contents: read
needs: [build-dashboard, smoke]
+ if: ${{ !cancelled() && needs.build-dashboard.result == 'success' && needs.smoke.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -410,19 +418,76 @@ jobs:
-t ghcr.io/${{ env.repo_owner }}/dashboard:${{ steps.tags.outputs.branch_name }}-${{ steps.tags.outputs.short_sha }} \
$(printf 'ghcr.io/${{ env.repo_owner }}/dashboard@sha256:%s ' *)
- - name: Create/Update Dashboard tag
- if: github.ref == 'refs/heads/main'
+ # Every build on main gets the next version: the git tag vX.Y.Z and the image
+ # tags X.Y.Z, X.Y and X, taken from this run's own digests. One run at a time,
+ # so two versions are never computed from the same last tag.
+ version:
+ if: ${{ github.ref == 'refs/heads/main' && !cancelled() && needs.merge-api.result == 'success' && needs.merge-dashboard.result == 'success' }}
+ needs: [merge-api, merge-dashboard]
+ runs-on: ubuntu-latest
+ concurrency:
+ group: main-version
+ cancel-in-progress: false
+ permissions:
+ contents: write
+ packages: write
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ fetch-tags: true
+
+ - uses: oven-sh/setup-bun@v2
+ with:
+ bun-version-file: ".bun-version"
+
+ - run: bun install --frozen-lockfile --filter @openpanel/release
+
+ - name: Decide the version
+ id: next
+ run: bun tooling/release/src/next-version.ts "$GITHUB_SHA"
+
+ - name: Download digests
+ if: steps.next.outputs.skip != 'true'
+ uses: actions/download-artifact@v4
+ with:
+ path: /tmp/digests
+ pattern: digests-*
+
+ - uses: docker/setup-buildx-action@v3
+ if: steps.next.outputs.skip != 'true'
+
+ - uses: docker/login-action@v3
+ if: steps.next.outputs.skip != 'true'
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Tag the images
+ if: steps.next.outputs.skip != 'true'
+ env:
+ VERSION: ${{ steps.next.outputs.version }}
+ MINOR: ${{ steps.next.outputs.minor }}
+ MAJOR: ${{ steps.next.outputs.major }}
+ run: |
+ set -euo pipefail
+ for app in api dashboard; do
+ image="ghcr.io/$repo_owner/$app"
+ # One file per platform, named after that platform's digest.
+ sources=()
+ for file in /tmp/digests/digests-"$app"-*/*; do
+ sources+=("$image@sha256:$(basename "$file")")
+ done
+ docker buildx imagetools create -t "$image:$VERSION" -t "$image:$MINOR" -t "$image:$MAJOR" "${sources[@]}"
+ echo "$image: $VERSION, $MINOR, $MAJOR"
+ done
+
+ # Pushed with GITHUB_TOKEN, which starts no workflow of its own.
+ - name: Tag the commit
+ if: steps.next.outputs.skip != 'true' && steps.next.outputs.is_new == 'true'
+ env:
+ VERSION: ${{ steps.next.outputs.version }}
run: |
- # Delete existing tag if it exists
- if git tag -l "dashboard" | grep -q "dashboard"; then
- git tag -d "dashboard"
- echo "Deleted local tag: dashboard"
- fi
-
- # Create new tag
- git tag "dashboard" "${{ github.sha }}"
- echo "Created tag: dashboard"
-
- # Push tag to remote
- git push origin "dashboard" --force
- echo "Pushed tag: dashboard"
+ git tag "v$VERSION" "$GITHUB_SHA"
+ git push origin "v$VERSION"
diff --git a/.github/workflows/self-hosting-release.yml b/.github/workflows/self-hosting-release.yml
new file mode 100644
index 000000000..808af2012
--- /dev/null
+++ b/.github/workflows/self-hosting-release.yml
@@ -0,0 +1,226 @@
+name: Self-hosting release
+
+# Moving the `self-hosting` tag (sh/tag-self-hosting) publishes the version
+# that commit was built as on main:
+# 1. its v* tag says which version it is (commits main never built have none)
+# 2. the images main already built and smoke-tested are copied to Docker Hub
+# 3. the CLI is built for every platform, stamped with the same version
+# 4. Claude writes the notes for everything since the previous public release
+# 5. a GitHub release `vX.Y.Z` carries the notes, the CLI and checksums.txt
+# That release is what `openpanel upgrade` and install.sh look for, and the
+# previous one is where the next release's notes start.
+on:
+ push:
+ tags:
+ - self-hosting
+
+concurrency:
+ group: self-hosting-release
+ cancel-in-progress: false
+
+env:
+ repo_owner: openpanel-dev
+ # The last release before this workflow existed; the first notes start here.
+ BASELINE_TAG: v2.3.0
+
+jobs:
+ resolve:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ version: ${{ steps.version.outputs.version }}
+ minor: ${{ steps.version.outputs.minor }}
+ major: ${{ steps.version.outputs.major }}
+ previous: ${{ steps.version.outputs.previous }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ fetch-tags: true
+
+ - name: Find the version to release
+ id: version
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ set -euo pipefail
+ tag="$(git tag --points-at "$GITHUB_SHA" --list 'v[0-9]*' | sort -V | tail -n 1)"
+ if [ -z "$tag" ]; then
+ echo "::error::$GITHUB_SHA has no v* version tag. Only commits that main has built and tagged can be released; move self-hosting to one of those."
+ exit 1
+ fi
+ version="${tag#v}"
+
+ previous="$(gh release list --exclude-drafts --exclude-pre-releases --limit 100 --json tagName --jq '.[].tagName' \
+ | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1 || true)"
+ previous="${previous:-$BASELINE_TAG}"
+ if ! git rev-parse -q --verify "refs/tags/$previous" >/dev/null; then
+ echo "::error::The previous release tag $previous does not exist, so the notes have no starting point."
+ exit 1
+ fi
+ newest="$(printf '%s\n%s\n' "$previous" "$tag" | sort -V | tail -n 1)"
+ if [ "$tag" = "$previous" ] || [ "$newest" != "$tag" ]; then
+ echo "::error::$tag is not newer than the last release $previous."
+ exit 1
+ fi
+
+ major="${version%%.*}"
+ minor="$(echo "$version" | cut -d. -f1-2)"
+ {
+ echo "version=$version"
+ echo "minor=$minor"
+ echo "major=$major"
+ echo "previous=$previous"
+ } >> "$GITHUB_OUTPUT"
+ echo "Releasing $tag (previous release: $previous)"
+
+ # Copies, never rebuilds: what ships is byte-identical to what main tested.
+ images:
+ needs: resolve
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: read
+ steps:
+ - uses: docker/setup-buildx-action@v3
+
+ - uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+ - name: Copy the tested images to Docker Hub
+ env:
+ VERSION: ${{ needs.resolve.outputs.version }}
+ MINOR: ${{ needs.resolve.outputs.minor }}
+ MAJOR: ${{ needs.resolve.outputs.major }}
+ run: |
+ set -euo pipefail
+ for app in api dashboard; do
+ target="lindesvard/openpanel-$app"
+ docker buildx imagetools create \
+ -t "$target:$VERSION" -t "$target:$MINOR" -t "$target:$MAJOR" -t "$target:latest" \
+ "ghcr.io/$repo_owner/$app:$VERSION"
+ echo "$target: $VERSION, $MINOR, $MAJOR, latest"
+ done
+
+ cli:
+ needs: resolve
+ permissions:
+ contents: read
+ strategy:
+ matrix:
+ include:
+ - { target: linux-x64, runner: ubuntu-latest, smoke: true }
+ - { target: linux-arm64, runner: ubuntu-latest, smoke: false }
+ # Built and signed on macOS: an unsigned binary is killed on launch
+ # on Apple Silicon.
+ - { target: darwin-arm64, runner: macos-latest, smoke: true }
+ - { target: darwin-x64, runner: macos-latest, smoke: false }
+ runs-on: ${{ matrix.runner }}
+ defaults:
+ run:
+ working-directory: self-hosting/cli
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: oven-sh/setup-bun@v2
+ with:
+ bun-version-file: ".bun-version"
+
+ - run: bun install --frozen-lockfile
+
+ - run: bun test
+
+ - name: Build
+ env:
+ VERSION: ${{ needs.resolve.outputs.version }}
+ run: bun build --compile --target="bun-${{ matrix.target }}" --define "OPENPANEL_RELEASE_VERSION=\"$VERSION\"" src/main.ts --outfile "dist/openpanel-${{ matrix.target }}"
+
+ - name: Sign (ad hoc)
+ if: runner.os == 'macOS'
+ run: |
+ codesign --force --sign - "dist/openpanel-${{ matrix.target }}"
+ codesign --verify --verbose "dist/openpanel-${{ matrix.target }}"
+
+ # Only where the runner can execute the target natively.
+ - name: Smoke test
+ if: matrix.smoke
+ env:
+ VERSION: ${{ needs.resolve.outputs.version }}
+ run: test "$("./dist/openpanel-${{ matrix.target }}" --version)" = "$VERSION"
+
+ - uses: actions/upload-artifact@v4
+ with:
+ name: openpanel-${{ matrix.target }}
+ path: self-hosting/cli/dist/openpanel-${{ matrix.target }}
+ if-no-files-found: error
+
+ notes:
+ needs: resolve
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ fetch-tags: true
+
+ - uses: oven-sh/setup-bun@v2
+ with:
+ bun-version-file: ".bun-version"
+
+ - run: bun install --frozen-lockfile --filter @openpanel/release
+
+ # Falls back to a plain commit list if the API is unavailable, so the
+ # release never waits on it.
+ - name: Write release notes
+ env:
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
+ run: bun tooling/release/src/release-notes.ts --from "${{ needs.resolve.outputs.previous }}" --to "v${{ needs.resolve.outputs.version }}" --out release-notes.md
+
+ - uses: actions/upload-artifact@v4
+ with:
+ name: release-notes
+ path: release-notes.md
+ if-no-files-found: error
+
+ publish:
+ needs: [resolve, images, cli, notes]
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - uses: actions/download-artifact@v4
+ with:
+ path: dist
+ pattern: openpanel-*
+ merge-multiple: true
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: release-notes
+
+ - name: Checksums
+ working-directory: dist
+ run: |
+ chmod +x openpanel-*
+ sha256sum openpanel-* > checksums.txt
+ cat checksums.txt
+
+ - name: Publish the release
+ env:
+ GH_TOKEN: ${{ github.token }}
+ VERSION: ${{ needs.resolve.outputs.version }}
+ run: |
+ gh release create "v$VERSION" dist/openpanel-* dist/checksums.txt \
+ --repo "$GITHUB_REPOSITORY" --verify-tag --latest \
+ --title "OpenPanel $VERSION" --notes-file release-notes.md
diff --git a/apps/public/content/docs/self-hosting/self-hosting.mdx b/apps/public/content/docs/self-hosting/self-hosting.mdx
index 22f5e90c8..a50ff1af7 100644
--- a/apps/public/content/docs/self-hosting/self-hosting.mdx
+++ b/apps/public/content/docs/self-hosting/self-hosting.mdx
@@ -33,7 +33,7 @@ The `openpanel` CLI is a single file with no dependencies. The script downloads
curl -fsSL https://raw.githubusercontent.com/Openpanel-dev/openpanel/main/self-hosting/install.sh | sh
```
-You can also download a binary from the [releases page](https://github.com/Openpanel-dev/openpanel/releases) (look for `cli-v*`).
+You can also download a binary from the [releases page](https://github.com/Openpanel-dev/openpanel/releases): every OpenPanel release includes the CLI for Linux and macOS, with a `checksums.txt`.
</Step>
<Step>
### Run the setup
diff --git a/sh/docker-build b/sh/docker-build
deleted file mode 100755
index 26e8972f7..000000000
--- a/sh/docker-build
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/bin/bash
-
-# Check for --dry-run flag anywhere in arguments
-DRY_RUN=false
-ARGS=()
-for arg in "$@"; do
- if [ "$arg" == "--dry-run" ] || [ "$arg" == "-n" ]; then
- DRY_RUN=true
- else
- ARGS+=("$arg")
- fi
-done
-
-APP=${ARGS[0]}
-VERSION=${ARGS[1]}
-PRERELEASE=${ARGS[2]} # Optional pre-release tag (e.g., "rc", "beta")
-
-if [ -z "$APP" ]; then
- echo "Please provide an app name as an argument."
- echo "Usage: $0 <app_name> <version> [pre-release-tag] [--dry-run]"
- echo "Examples:"
- echo " $0 all 2.1.0 # Tags: 2.1.0, 2.1, 2, latest"
- echo " $0 all 2.1.0 rc # Tags: 2.1.0-rc only"
- echo " $0 all 2.1.0 --dry-run # Dry run, shows what would be built"
- echo " $0 all 2.1.0 rc --dry-run # Dry run for pre-release"
- exit 1
-fi
-
-# Check if version is provided
-if [ -z "$VERSION" ]; then
- echo "Please provide a version number as an argument."
- echo "Usage: $0 $APP <version> [pre-release-tag]"
- exit 1
-fi
-
-# Validate version format (x.x.x)
-if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
- echo "Error: Version must be in format x.x.x (e.g., 2.1.0)"
- exit 1
-fi
-
-# Extract major and minor versions
-MAJOR=$(echo "$VERSION" | cut -d. -f1)
-MINOR=$(echo "$VERSION" | cut -d. -f1-2)
-
-# Display build info
-if [ "$DRY_RUN" = true ]; then
- echo "=== DRY RUN MODE ==="
- echo ""
-fi
-
-if [ -z "$PRERELEASE" ]; then
- echo "Building RELEASE version $VERSION"
- echo "Tags that will be created: $VERSION, $MINOR, $MAJOR, latest"
-else
- echo "Building PRE-RELEASE version $VERSION-$PRERELEASE"
- echo "Tags that will be created: $VERSION-$PRERELEASE"
-fi
-
-# Skip confirmation and docker setup in dry run mode
-if [ "$DRY_RUN" = true ]; then
- echo ""
-else
- read -p "Do you wish to continue (y/N)? " -n 1 -r
- echo # Move to a new line
- if [[ ! $REPLY =~ ^[Yy]$ ]]
- then
- echo "Aborting..."
- exit 1
- fi
-
- # Ensure Docker Buildx is available and set up a builder
- docker buildx rm multi-arch-builder 2>/dev/null || true # Remove existing builder if it exists
- docker buildx create --name multi-arch-builder --use || true
-fi
-
-# Function to build a multi-architecture image
-build_image() {
- local app=$1
- local image_name="lindesvard/openpanel-$app"
-
- # Use apps/start/Dockerfile for dashboard app
- local dockerfile="apps/$app/Dockerfile"
- if [ "$app" = "dashboard" ]; then
- dockerfile="apps/start/Dockerfile"
- fi
-
- if [ "$DRY_RUN" = true ]; then
- # Dry run - just show what would be built
- echo "Would build: $app"
- echo " Dockerfile: $dockerfile"
- if [ -n "$PRERELEASE" ]; then
- echo " Image: $image_name:$VERSION-$PRERELEASE"
- else
- echo " Images:"
- echo " - $image_name:$VERSION"
- echo " - $image_name:$MINOR"
- echo " - $image_name:$MAJOR"
- echo " - $image_name:latest"
- fi
- echo ""
- return 0
- fi
-
- # Actual build
- if [ -n "$PRERELEASE" ]; then
- # Pre-release: only tag with x.x.x-prerelease
- local tag="$image_name:$VERSION-$PRERELEASE"
- echo "(pre-release) Building multi-architecture image: $tag"
- docker buildx build \
- --platform linux/amd64,linux/arm64 \
- -t "$tag" \
- --build-arg DATABASE_URL="postgresql://p@p:5432/p" \
- -f "$dockerfile" \
- --push \
- .
- else
- # Release: tag with x.x.x, x.x, x, and latest
- echo "(release) Building multi-architecture image for $image_name"
- echo " Tags: $VERSION, $MINOR, $MAJOR, latest"
- docker buildx build \
- --platform linux/amd64,linux/arm64 \
- -t "$image_name:$VERSION" \
- -t "$image_name:$MINOR" \
- -t "$image_name:$MAJOR" \
- -t "$image_name:latest" \
- --build-arg DATABASE_URL="postgresql://p@p:5432/p" \
- -f "$dockerfile" \
- --push \
- .
- fi
-
- if [ $? -ne 0 ]; then
- echo "Failed to build $image_name:$VERSION"
- exit 1
- fi
-
- echo "Successfully built and pushed multi-architecture image for $image_name"
-}
-
-if [ "$APP" == "all" ]; then
- build_image "dashboard"
- build_image "worker"
- build_image "api"
- if [ "$DRY_RUN" = false ]; then
- echo ""
- echo "All images built and pushed successfully!"
- if [ -z "$PRERELEASE" ]; then
- echo "Tagged as: $VERSION, $MINOR, $MAJOR, latest"
- else
- echo "Tagged as: $VERSION-$PRERELEASE"
- fi
- fi
-else
- build_image $APP
- if [ "$DRY_RUN" = false ]; then
- echo ""
- echo "Image for $APP built and pushed successfully!"
- if [ -z "$PRERELEASE" ]; then
- echo "Tagged as: $VERSION, $MINOR, $MAJOR, latest"
- else
- echo "Tagged as: $VERSION-$PRERELEASE"
- fi
- fi
-fi
diff --git a/tooling/release/src/git.ts b/tooling/release/src/git.ts
index 3d53781f3..ac718f1e3 100644
--- a/tooling/release/src/git.ts
+++ b/tooling/release/src/git.ts
@@ -4,6 +4,8 @@ export const git = (...args: string[]): string =>
execFileSync('git', args, {
encoding: 'utf8',
maxBuffer: 256 * 1024 * 1024,
+ // Expected misses (no earlier tag) would otherwise print "fatal: ..." into CI logs.
+ stdio: ['ignore', 'pipe', 'pipe'],
}).trim();
// Absent refs are normal here (no earlier tag), so they return null rather than throw.
diff --git a/tooling/release/tsconfig.json b/tooling/release/tsconfig.json
index 7dd5678bf..02874d7ea 100644
--- a/tooling/release/tsconfig.json
+++ b/tooling/release/tsconfig.json
@@ -3,14 +3,8 @@
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
"strictNullChecks": true,
- "types": [
- "bun-types"
- ]
+ "types": ["bun-types"]
},
- "include": [
- "."
- ],
- "exclude": [
- "node_modules"
- ]
+ "include": ["."],
+ "exclude": ["node_modules"]
}