Add manual‐only, parameterized build workflow

This commit is contained in:
Donato Capitella
2025-08-06 09:46:49 +01:00
parent c8019bdc0e
commit 55d96f4d93
+14 -13
View File
@@ -1,6 +1,6 @@
# File: .github/workflows/build_and_publish.yml
name: Build & Publish AMD Strix Halo Toolboxes name: Build & Publish AMD Strix Halo Toolboxes
# 🔒 Manualonly trigger with a “backends” input
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
@@ -8,7 +8,7 @@ on:
description: > description: >
Comma-separated list of backends to build Comma-separated list of backends to build
(e.g. "rocm-7beta,rocm-7rc"). (e.g. "rocm-7beta,rocm-7rc").
Use `all` to build everything. Use "all" to build the full matrix.
required: false required: false
default: all default: all
@@ -18,6 +18,7 @@ env:
jobs: jobs:
build-and-push: build-and-push:
name: Build & Push ${{ matrix.backend }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
@@ -32,7 +33,8 @@ jobs:
) }} ) }}
steps: steps:
- uses: actions/checkout@v3 - name: Check out code
uses: actions/checkout@v3
- name: Log in to Docker Hub - name: Log in to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
@@ -40,28 +42,27 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set build timestamp - name: Set timestamp
run: echo "BUILD_TS=$(date +%Y%m%dT%H%M%S)" >> $GITHUB_ENV run: echo "BUILD_TS=$(date +%Y%m%dT%H%M%S)" >> $GITHUB_ENV
- name: Build & push ${{ matrix.backend }} - name: Build & push ${{ matrix.backend }}
working-directory: toolboxes working-directory: toolboxes
run: | run: |
set -euo pipefail set -euo pipefail
B="${{ matrix.backend }}" B="${{ matrix.backend }}"
DF="Dockerfile.$B" DF="Dockerfile.$B"
LI="${LOCAL_PREFIX}-$B" LI="${LOCAL_PREFIX}-$B"
TAG="${B}_${BUILD_TS}" TAG="${B}_${BUILD_TS}"
IMM="${DOCKERHUB_REPO}:$TAG" IMM_REF="${DOCKERHUB_REPO}:$TAG"
CHAN="${DOCKERHUB_REPO}:$B" CH_REF="${DOCKERHUB_REPO}:$B"
echo "→ Building $DF" echo "→ Building $DF"
docker build --no-cache -t "$LI" -f "$DF" . docker build --no-cache -t "$LI" -f "$DF" .
echo "→ Pushing immutable → $IMM" echo "→ Pushing immutable → $IMM_REF"
docker tag "$LI" "$IMM" docker tag "$LI" "$IMM_REF"
docker push "$IMM" docker push "$IMM_REF"
echo "→ Updating channel → $CHAN" echo "→ Updating channel → $CH_REF"
docker tag "$IMM" "$CHAN" docker tag "$IMM_REF" "$CH_REF"
docker push "$CHAN" docker push "$CH_REF"