From fb6b4f3f5c3683739badb48dede6680ebb9b732e Mon Sep 17 00:00:00 2001 From: moltenhub-bot Date: Tue, 19 May 2026 15:37:38 +0000 Subject: [PATCH] chore: using GoReleaser -> GitHub Releases (The Artifact Store) this Co-authored-by: Molten Bot 000 <260473928+moltenbot000@users.noreply.github.com> --- .github/workflows/deploy-prod.yml | 32 +++++++++++++++++++-- .goreleaser.yml | 46 +++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 .goreleaser.yml diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 299001e..a0ae4d5 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -18,11 +18,11 @@ concurrency: jobs: promote-harness-variants: - name: Promote image to latest + name: Promote image and publish release artifacts runs-on: ubuntu-latest timeout-minutes: 15 permissions: - contents: read + contents: write id-token: write attestations: write strategy: @@ -30,6 +30,17 @@ jobs: env: IMAGE_NAME: docker.io/moltenai/moltenhub-dispatch steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version-file: go.mod + cache: true + - name: Setup Docker Buildx uses: docker/setup-buildx-action@v4 @@ -60,3 +71,20 @@ jobs: subject-digest: ${{ steps.digest.outputs.value }} push-to-registry: true create-storage-record: false + + - name: Compute GitHub Release tag + id: release + run: | + RELEASE_TAG="$(date -u +'v%Y.%-m.%-d')+${GITHUB_RUN_NUMBER}.${GITHUB_RUN_ATTEMPT}" + echo "tag=${RELEASE_TAG}" >> "$GITHUB_OUTPUT" + + - name: Publish GitHub Release artifacts + uses: goreleaser/goreleaser-action@v7 + with: + distribution: goreleaser + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_CURRENT_TAG: ${{ steps.release.outputs.tag }} + SOURCE_TAG: ${{ github.event.inputs.source_tag }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..852c72f --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,46 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +version: 2 + +project_name: moltenhub-dispatch + +before: + hooks: + - go mod download + +builds: + - id: moltenhub-dispatch + main: ./cmd/moltenhub-dispatch + binary: moltenhub-dispatch + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + +archives: + - id: moltenhub-dispatch + ids: + - moltenhub-dispatch + formats: + - tar.gz + format_overrides: + - goos: windows + formats: + - zip + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" + +release: + prerelease: false + make_latest: true + header: | + Docker image promoted from `{{ .Env.SOURCE_TAG }}` to `latest`. + +changelog: + sort: asc