From 14236ac794a75d8c0fd0b32273cdcfc1642505b6 Mon Sep 17 00:00:00 2001 From: Lucas Ritzdorf <42657792+LRitzdorf@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:13:21 -0600 Subject: [PATCH] release: update workflows to publish container This steals work from b1beac0. --- .github/workflows/main.yml | 10 +++++++--- .goreleaser.yaml | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 97aaf48..2629cfd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,13 +6,11 @@ on: tags: - v* -permissions: write-all # Necessary for the generate-build-provenance action with containers +permissions: write-all jobs: build: - - runs-on: ubuntu-latest steps: @@ -20,6 +18,12 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.21 + - name: Docker Login + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Checkout uses: actions/checkout@v4 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 7e7b51d..ed4d7dc 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -25,10 +25,28 @@ archives: - CHANGELOG.md - README.md - bin/magellan.sh +dockers: + - + image_templates: + - ghcr.io/openchami/{{.ProjectName}}:latest + - ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }} + - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }} + - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }} + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + extra_files: + - LICENSE + - CHANGELOG.md + - README.md + - bin/magellan.sh checksum: name_template: 'checksums.txt' snapshot: - name_template: "{{ incpatch .Version }}-next" + version_template: "{{ incpatch .Version }}-next" changelog: sort: asc filters: