From 02cd067604a8d59db0aabaab443279aca0deee30 Mon Sep 17 00:00:00 2001 From: Alex Lovell-Troy Date: Tue, 19 May 2026 21:41:46 -0400 Subject: [PATCH 1/3] chore: update GitHub Actions to use latest versions of setup-go, checkout, and golangci-lint Signed-off-by: Alex Lovell-Troy --- .github/workflows/build_and_release_image.yaml | 16 ++++++++-------- .github/workflows/integration_test.yaml | 4 ++-- .github/workflows/lint.yaml | 6 +++--- .github/workflows/unit_test.yaml | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build_and_release_image.yaml b/.github/workflows/build_and_release_image.yaml index dab820c..701d1d7 100644 --- a/.github/workflows/build_and_release_image.yaml +++ b/.github/workflows/build_and_release_image.yaml @@ -17,14 +17,14 @@ jobs: sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - name: Set up latest stable Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: stable - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 - name: Checkout out the repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-tags: 1 fetch-depth: 1 @@ -38,13 +38,13 @@ jobs: echo "BUILD_USER=$(whoami)" >> $GITHUB_ENV - name: Docker Login - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Release with goreleaser - uses: goreleaser/goreleaser-action@v6 + uses: goreleaser/goreleaser-action@v7 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -64,16 +64,16 @@ jobs: echo "digest=$(cat digest.txt)" >> $GITHUB_OUTPUT - name: Attest power-control binary amd64 - uses: actions/attest-build-provenance@v1 + uses: actions/attest-build-provenance@v4 with: subject-path: dist/remote-console_linux_amd64_v3/remote-console # TODO: ARM builds aren't viable yet #- name: Attest power-control binary arm64 - # uses: actions/attest-build-provenance@v1 + # uses: actions/attest-build-provenance@v4 # with: # subject-path: dist/pcs_linux_arm64_v8.0/power-control - name: Generate build provenance - uses: actions/attest-build-provenance@v1 + uses: actions/attest-build-provenance@v4 with: subject-name: ghcr.io/openchami/remote-console subject-digest: ${{ steps.process_goreleaser_output.outputs.digest }} diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index ce2cf72..c4bff08 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version-file: go.mod - name: Build remote-console binary for Dockerfile diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 4328435..dcd15b9 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -12,12 +12,12 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup Go 1.26 - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: 1.26 - name: golangci-lint - uses: golangci/golangci-lint-action@v8 + uses: golangci/golangci-lint-action@v9 with: version: latest diff --git a/.github/workflows/unit_test.yaml b/.github/workflows/unit_test.yaml index 92471e1..f118d78 100644 --- a/.github/workflows/unit_test.yaml +++ b/.github/workflows/unit_test.yaml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version-file: go.mod - name: Run unit tests From 72dacd300deb0d38d72ca56dae307c67dd84df38 Mon Sep 17 00:00:00 2001 From: Alex Lovell-Troy Date: Tue, 19 May 2026 21:59:42 -0400 Subject: [PATCH 2/3] chore: update goreleaser configuration and Dockerfile for improved build automation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dockers + docker_manifests → dockers_v2 — replaces ~65 lines of architecture-specific image templates + separate manifest declarations with a single 29-line block. GoReleaser now runs one docker buildx build that builds and pushes the manifest atomically. ARM support later is a one-line addition to platforms. OCI labels move from --label=… strings into a proper annotations map. changelog.use: github — uses GitHub's compare API to append @handle attribution on each release note entry, which is meaningful for an open-source project. Adds groups for structured release notes: Features / Bug Fixes / Others, using conventional-commit patterns. Also excludes chore: commits alongside the existing docs: and test:. Signed-off-by: Alex Lovell-Troy --- .goreleaser.yaml | 90 ++++++++++++++++++------------------------------ Dockerfile | 4 ++- 2 files changed, 36 insertions(+), 58 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b17bd17..72e8ac0 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,4 +1,4 @@ -version: 2.4 +version: 2 project_name: remote-console before: @@ -36,22 +36,29 @@ builds: -X main.GoVersion={{ .Env.GO_VERSION }} \ -X main.BuildUser={{ .Env.BUILD_USER }} " -dockers: - - image_templates: - - &amd64_linux_image ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-amd64 - - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-amd64 - - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-amd64 - use: buildx - build_flag_templates: +dockers_v2: + - id: remote-console + ids: + - remote-console + dockerfile: Dockerfile + images: + - ghcr.io/openchami/{{.ProjectName}} + tags: + - "{{ .Tag }}" + - "{{ .Major }}" + - "{{ .Major }}.{{ .Minor }}" + - "latest" + platforms: + - linux/amd64 + # TODO: Add linux/arm64 when ARM base images and conman packages are available + flags: - "--pull" - "--target=ubuntu-goreleaser" - - "--platform=linux/amd64" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - goarch: amd64 - goamd64: v3 + annotations: + "org.opencontainers.image.created": "{{.Date}}" + "org.opencontainers.image.title": "{{.ProjectName}}" + "org.opencontainers.image.revision": "{{.FullCommit}}" + "org.opencontainers.image.version": "{{.Version}}" extra_files: - LICENSE - CHANGELOG.md @@ -59,48 +66,6 @@ dockers: - configs/ - scripts/ - # TODO: more ARM config that isn't viable yet. - #- image_templates: - # - &arm64v8_linux_image ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-arm64 - # - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-arm64 - # - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-arm64 - # use: buildx - # build_flag_templates: - # - "--pull" - # - "--platform=linux/arm64" - # - "--label=org.opencontainers.image.created={{.Date}}" - # - "--label=org.opencontainers.image.title={{.ProjectName}}" - # - "--label=org.opencontainers.image.revision={{.FullCommit}}" - # - "--label=org.opencontainers.image.version={{.Version}}" - # goarch: arm64 - # extra_files: - # - LICENSE - # - CHANGELOG.md - # - README.md - # - configs/ - -docker_manifests: - # TODO: ARM ARM ARM - - name_template: "ghcr.io/openchami/{{.ProjectName}}:latest" - image_templates: - - *amd64_linux_image - #- *arm64v8_linux_image - - - name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}" - image_templates: - - *amd64_linux_image - #- *arm64v8_linux_image - - - name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}" - image_templates: - - *amd64_linux_image - #- *arm64v8_linux_image - - - name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}" - image_templates: - - *amd64_linux_image - #- *arm64v8_linux_image - archives: - formats: ["tar.gz"] # this name template makes the OS and Arch compatible with the results of uname. @@ -121,11 +86,22 @@ checksum: snapshot: version_template: "{{ incpatch .Version }}-next" changelog: + use: github sort: asc + groups: + - title: Features + regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$' + order: 0 + - title: Bug Fixes + regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$' + order: 1 + - title: Others + order: 999 filters: exclude: - '^docs:' - '^test:' + - '^chore:' # The lines beneath this are called `modelines`. See `:help modeline` diff --git a/Dockerfile b/Dockerfile index e07076d..98cbb91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,10 +10,12 @@ FROM ubuntu:24.04 AS ubuntu-goreleaser +ARG TARGETPLATFORM + RUN apt -y update RUN apt -y install conman less vim ssh jq tar procps inotify-tools -COPY remote-console /app/ +COPY ${TARGETPLATFORM}/remote-console /app/ COPY scripts/conman.conf.tmpl /app/conman.conf.tmpl COPY scripts/ssh-key-console /usr/bin/ COPY scripts/ssh-pwd-console /usr/bin/ From 9ea4b9d2584f5e41e6631d5ca2de96599f2cfcc2 Mon Sep 17 00:00:00 2001 From: Alex Lovell-Troy Date: Tue, 19 May 2026 22:11:24 -0400 Subject: [PATCH 3/3] chore: add GitHub Actions workflow for building and publishing ipmi-sim Signed-off-by: Alex Lovell-Troy --- .github/workflows/build_ipmi_sim.yaml | 55 +++++++++++++++++++++++++++ ipmi_sim/VERSION | 1 + 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/build_ipmi_sim.yaml create mode 100644 ipmi_sim/VERSION diff --git a/.github/workflows/build_ipmi_sim.yaml b/.github/workflows/build_ipmi_sim.yaml new file mode 100644 index 0000000..3026f3b --- /dev/null +++ b/.github/workflows/build_ipmi_sim.yaml @@ -0,0 +1,55 @@ +name: Build and publish ipmi-sim + +on: + push: + branches: + - main + paths: + - 'ipmi_sim/**' + - 'ipmi_sim/VERSION' + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v6 + + - name: Read version + id: version + run: echo "version=$(cat ipmi_sim/VERSION)" >> "$GITHUB_OUTPUT" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Docker Login + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v6 + with: + images: ghcr.io/openchami/ipmi-sim + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=${{ steps.version.outputs.version }} + type=sha,prefix=,format=short + + - name: Build and push + uses: docker/build-push-action@v7 + with: + context: ipmi_sim + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/ipmi_sim/VERSION b/ipmi_sim/VERSION new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/ipmi_sim/VERSION @@ -0,0 +1 @@ +0.1.0