Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/actions/build-binaries/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build Binaries
description: Build Temporal binaries using GoReleaser

inputs:
snapshot:
description: "Use snapshot mode (true) or release mode (false). Only applies to release command (build always uses snapshot)."
required: false
default: "true"
single-arch:
description: "Single architecture to build (amd64 or arm64, empty for all). Only used with build command, ignored if release is true."
required: false
default: ""
release:
description: "Use release command (true) or build command (false). When true, single-arch is ignored and snapshot is respected."
required: false
default: "false"

runs:
using: composite
steps:
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
cache: true

- name: Run GoReleaser (release)
if: inputs.release == 'true'
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: v2.13.1
args: release ${{ inputs.snapshot == 'true' && '--snapshot --skip=publish' || '' }} --clean
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Run GoReleaser (build)
if: inputs.release != 'true'
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: v2.13.1
args: build --snapshot ${{ inputs.single-arch != '' && '--single-target' || '' }}
env:
GITHUB_TOKEN: ${{ github.token }}
GOOS: ${{ inputs.single-arch != '' && 'linux' || '' }}
GOARCH: ${{ inputs.single-arch }}
133 changes: 133 additions & 0 deletions .github/actions/build-docker-images/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Build Docker Images
description: |
Build Temporal Docker images from binaries.

Prerequisites:
- The build-binaries action must run before this action to produce the binaries.

inputs:
push:
description: "Push images to Docker Hub"
required: false
default: "false"
tag-latest:
description: "Tag images as latest"
required: false
default: "false"
platform:
description: "Single platform to build (e.g., linux/amd64)"
required: false
default: ""
load:
description: "Load image into local Docker daemon (only works with linux/amd64 - the runner architecture)"
required: false
default: "false"
cli-version:
description: "Temporal CLI version to download"
required: false
default: "1.5.1"
alpine-tag:
description: "Alpine base image tag with digest"
required: false
default: "3.23@sha256:c78ded0fee4493809c8ca71d4a6057a46237763d952fae15ea418f6d14137f2d"
dockerhub-username:
description: "Docker Hub username"
required: false
dockerhub-token:
description: "Docker Hub token"
required: false

runs:
using: composite
steps:
- name: Build docker-build-helper
shell: bash
working-directory: ${{ github.workspace }}/.github/actions/build-docker-images/scripts
run: |
go build -o docker-build-helper .

- name: Validate and sanitize branch name for Docker tag
id: sanitize-tag
shell: bash
working-directory: ${{ github.workspace }}
run: |
.github/actions/build-docker-images/scripts/docker-build-helper sanitize-tag

- name: Organize binaries for Docker
id: organize-binaries
shell: bash
working-directory: ${{ github.workspace }}
env:
PLATFORM: ${{ inputs.platform }}
run: |
.github/actions/build-docker-images/scripts/docker-build-helper organize-binaries

- name: Download Temporal CLI
shell: bash
working-directory: ${{ github.workspace }}
env:
AVAILABLE_ARCHS: ${{ steps.organize-binaries.outputs.available-archs }}
CLI_VERSION: ${{ inputs.cli-version }}
run: |
.github/actions/build-docker-images/scripts/docker-build-helper download-cli

- name: Extract server version from binary
id: extract-version
shell: bash
working-directory: ${{ github.workspace }}
run: |
.github/actions/build-docker-images/scripts/docker-build-helper extract-version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
if: inputs.push == 'true'
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub-username }}
password: ${{ inputs.dockerhub-token }}

- name: Build Docker images
if: inputs.push != 'true'
shell: bash
working-directory: ${{ github.workspace }}
env:
IMAGE_REPO: temporaliotest
IMAGE_SHA_TAG: ${{ github.sha }}
IMAGE_BRANCH_TAG: ${{ steps.sanitize-tag.outputs.tag }}
TEMPORAL_SHA: ${{ github.sha }}
TAG_LATEST: ${{ inputs.tag-latest }}
ALPINE_TAG: ${{ inputs.alpine-tag }}
SERVER_VERSION: ${{ steps.extract-version.outputs.server-version }}
run: |
if [ -n "${{ inputs.platform }}" ]; then
docker buildx bake \
--set "*.platform=${{ inputs.platform }}" \
${{ inputs.load == 'true' && '--load' || '' }} \
-f docker/docker-bake.hcl \
server admin-tools
else
docker buildx bake \
${{ inputs.load == 'true' && '--load' || '' }} \
-f docker/docker-bake.hcl \
server admin-tools
fi

- name: Build and push Docker images
if: inputs.push == 'true'
shell: bash
working-directory: ${{ github.workspace }}
env:
IMAGE_REPO: temporaliotest
IMAGE_SHA_TAG: ${{ github.sha }}
IMAGE_BRANCH_TAG: ${{ steps.sanitize-tag.outputs.tag }}
TEMPORAL_SHA: ${{ github.sha }}
TAG_LATEST: ${{ inputs.tag-latest }}
ALPINE_TAG: ${{ inputs.alpine-tag }}
SERVER_VERSION: ${{ steps.extract-version.outputs.server-version }}
run: |
docker buildx bake \
--push \
-f docker/docker-bake.hcl \
server admin-tools
1 change: 1 addition & 0 deletions .github/actions/build-docker-images/scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker-build-helper
Loading
Loading