Skip to content

.

. #3

Workflow file for this run

name: Build Binaries
on:
workflow_dispatch:
inputs:
release_tag:
description: "Existing tag/release to build, such as test35 or v35"
required: false
type: string
push:
tags:
- "*"
release:
types:
- published
permissions:
contents: write
jobs:
docker-build:
name: Docker Release Build
runs-on: ubuntu-24.04
timeout-minutes: 240
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || inputs.release_tag || github.ref }}
- name: Build release Docker image
run: |
docker build \
--progress=plain \
--build-arg GO_VERSION=1.26.3 \
-t gothoom-build-env \
.
- name: Extract release artifacts
run: |
rm -rf dist
mkdir -p dist
container_id="$(docker create gothoom-build-env)"
docker cp "$container_id:/binaries/." dist/
docker rm "$container_id"
find dist -maxdepth 1 -type f -name '*.zip' -print | sort
test -n "$(find dist -maxdepth 1 -type f -name '*.zip' -print -quit)"
(
cd dist
sha256sum *.zip > SHA256SUMS.txt
)
- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: gothoom-binaries
path: |
dist/*.zip
dist/SHA256SUMS.txt
if-no-files-found: error
- name: Publish GitHub Release artifacts
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/') || inputs.release_tag != ''
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.release_tag || github.ref_name }}
run: |
tag="$RELEASE_TAG"
if gh release view "$tag" >/dev/null 2>&1; then
gh release upload "$tag" dist/*.zip dist/SHA256SUMS.txt --clobber
else
gh release create "$tag" dist/*.zip dist/SHA256SUMS.txt \
--title "$tag" \
--notes "Automated goThoom build for $tag"
fi