hotpocket/.gitea/actions/get-build-options/action.yaml
Tomek Wójcik 10fccc17f7 BTHLABS-0000: development workflow
Co-authored-by: Tomek Wójcik <labs@tomekwojcik.pl>
Co-committed-by: Tomek Wójcik <labs@tomekwojcik.pl>
2025-10-17 06:49:10 +00:00

27 lines
866 B
YAML

name: "Get Build Options"
description: "Sanitizies and unifies the environment into build options"
outputs:
short-sha:
description: "Shortened hash if the current commit"
build-arch:
description: "Docker-compatible representation of build arch"
build-platform:
description: "Docker-compatible representation of build platform"
runs:
using: "composite"
steps:
- name: "Compute Build Options"
shell: "bash"
run: |
set -x
SHORT_SHA="${GITHUB_SHA::8}"
BUILD_ARCH="amd64"
BUILD_PLATFORM="linux/amd64"
if [ "${RUNNER_ARCH}" = "ARM64" ];then
BUILD_ARCH="arm64"
BUILD_PLATFORM="linux/arm64"
fi
echo "short-sha=$SHORT_SHA" >> $GITHUB_OUTPUT
echo "build-arch=$BUILD_ARCH" >> $GITHUB_OUTPUT
echo "build-platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT