All checks were successful
Run Check Script / check (pull_request) Successful in 2m22s
Workflow yaml had a 12-line inline bash block computing the release version from `GITHUB_REF_NAME` or `inputs.version`. Moves the logic into `.gitea/scripts/resolve-release-version.sh` so the workflow yaml is back to one-line invocations and the resolver is reusable by sibling component workflows (agent, callout). This is the interim form. The real fix is a harmony Rust binary that understands git refs directly — see PR thread on framework- level build/package/release ownership.
70 lines
2.5 KiB
YAML
70 lines
2.5 KiB
YAML
name: Release harmony-fleet-operator (image + chart)
|
|
on:
|
|
push:
|
|
tags:
|
|
# Per-crate release tag. One tag → one image + one chart, both
|
|
# at the same version. Format: `harmony-fleet-operator-v0.1.0`.
|
|
- 'harmony-fleet-operator-v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version tag to release (e.g. v0.1.0). Required for manual runs.'
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
release:
|
|
container:
|
|
image: hub.nationtech.io/harmony/harmony_composer:latest
|
|
runs-on: dind
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to hub.nationtech.io (docker)
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: hub.nationtech.io
|
|
username: ${{ secrets.HUB_BOT_USER }}
|
|
password: ${{ secrets.HUB_BOT_PASSWORD }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
# helm is not in harmony_composer:latest at time of writing; pull
|
|
# the official installer. One-shot, no apt source needed.
|
|
#
|
|
# TODO: bake helm into harmony_composer so this step disappears.
|
|
- name: Install helm
|
|
run: |
|
|
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
|
|
|
- name: Log in to hub.nationtech.io (helm OCI)
|
|
run: |
|
|
echo "${{ secrets.HUB_BOT_PASSWORD }}" \
|
|
| helm registry login hub.nationtech.io \
|
|
--username "${{ secrets.HUB_BOT_USER }}" \
|
|
--password-stdin
|
|
|
|
- name: Resolve version
|
|
id: ver
|
|
run: |
|
|
VERSION=$(.gitea/scripts/resolve-release-version.sh \
|
|
"harmony-fleet-operator-" "$GITHUB_REF_NAME" "${{ inputs.version }}")
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
|
|
# Same script a developer would run from their laptop in an
|
|
# outage. All build logic lives in Rust under
|
|
# fleet/harmony-fleet-deploy; CI is just a thin trigger.
|
|
#
|
|
# TODO (carried over from the previous workflow): add buildx
|
|
# layer caching. Each run currently recompiles the whole
|
|
# `harmony` workspace from scratch in the Dockerfile's builder
|
|
# stage. cargo-chef + `cache-from: type=gha` would help once
|
|
# build time becomes the bottleneck.
|
|
- name: Build and push image + chart
|
|
run: |
|
|
./fleet/harmony-fleet-operator/release.sh \
|
|
hub.nationtech.io \
|
|
"${{ steps.ver.outputs.version }}"
|