From 3c4f89cd839ed170c1888893d791667ab206b3b2 Mon Sep 17 00:00:00 2001 From: Fred Date: Tue, 17 Feb 2026 20:44:27 +0000 Subject: [PATCH 1/4] chore: fix goreleaser configurations using new dockers_v2 --- .github/workflows/build.yaml | 66 ++++++++++++++++++++--------------- .github/workflows/docker.yml | 7 ++++ .github/workflows/release.yml | 7 ++++ .goreleaser.yml | 61 ++++++++++---------------------- build/Dockerfile | 1 - 5 files changed, 70 insertions(+), 72 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e6c01d6..f96c22f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,32 +18,40 @@ jobs: steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v5 - - - name: Set up Go ${{ matrix.go_version }} - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go_version }} - - - name: Get dependencies - run: | - go mod download - - - name: Build - run: go build -v ./... - - - name: Test - run: "go test -v -short -race -coverprofile='coverage.out' ./..." - shell: bash - - - name: Code coverage - uses: codecov/codecov-action@v5 - with: - env_vars: OS,GO - files: ./coverage.out - flags: unittests - fail_ci_if_error: false - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} - continue-on-error: true + - name: Check out code into the Go module directory + uses: actions/checkout@v5 + + - name: Set up Go ${{ matrix.go_version }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go_version }} + + - name: Get dependencies + run: | + go mod download + + - name: Build + run: go build -v ./... + + - name: Test + run: "go test -v -short -race -coverprofile='coverage.out' ./..." + shell: bash + + - name: Code coverage + uses: codecov/codecov-action@v5 + with: + env_vars: OS,GO + files: ./coverage.out + flags: unittests + fail_ci_if_error: false + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + continue-on-error: true + + - name: Check GoReleaser configurations + uses: goreleaser/goreleaser-action@v6 + with: + version: '~> v2' + args: release check .goreleaser-docker-only.yml .goreleaser.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fd69d09..7ad3b87 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -36,6 +36,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Install eget run: go install github.com/zyedidia/eget@latest env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f7aa68..5f60c7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Install eget run: go install github.com/zyedidia/eget@latest env: diff --git a/.goreleaser.yml b/.goreleaser.yml index 330c39d..d67e2eb 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -61,51 +61,28 @@ changelog: - "^docs:" - "^test:" -dockers: - - image_templates: - - "creativeprojects/imap:latest-amd64" - - "creativeprojects/imap:{{ .RawVersion }}-amd64" - ids: - - imap_targz - use: buildx - goos: linux - goarch: amd64 +dockers_v2: + - images: + - "creativeprojects/imap" + - "ghcr.io/creativeprojects/imap" dockerfile: build/Dockerfile - 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}}" - - "--platform=linux/amd64" - - "--build-arg=ARCH=amd64" - - image_templates: - - "creativeprojects/imap:latest-arm64v8" - - "creativeprojects/imap:{{ .RawVersion }}-arm64v8" ids: - imap_targz - use: buildx - goos: linux - goarch: arm64 - dockerfile: build/Dockerfile - 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}}" - - "--platform=linux/arm64/v8" - - "--build-arg=ARCH=arm64" - -docker_manifests: - - name_template: creativeprojects/imap:{{ .RawVersion }} - image_templates: - - creativeprojects/imap:{{ .RawVersion }}-amd64 - - creativeprojects/imap:{{ .RawVersion }}-arm64v8 - - name_template: creativeprojects/imap:latest - image_templates: - - creativeprojects/imap:latest-amd64 - - creativeprojects/imap:latest-arm64v8 + tags: + - "{{ .RawVersion }}" + - "{{ if .IsNightly }}nightly{{ end }}" + - "{{ if not .IsNightly }}latest{{ end }}" + labels: + "org.opencontainers.image.description": "IMAP tools: backup, copy, move your emails between servers and locally" + "org.opencontainers.image.created": "{{.Date}}" + "org.opencontainers.image.name": "{{.ProjectName}}" + "org.opencontainers.image.title": "{{.ProjectName}}" + "org.opencontainers.image.revision": "{{.FullCommit}}" + "org.opencontainers.image.version": "{{.Version}}" + "org.opencontainers.image.source": "{{.GitURL}}" + platforms: + - linux/amd64 + - linux/arm64 brews: - name: imap diff --git a/build/Dockerfile b/build/Dockerfile index 7520187..90b1154 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -2,7 +2,6 @@ FROM alpine:latest LABEL maintainer Fred -ARG ARCH=amd64 ARG TARGETPLATFORM COPY $TARGETPLATFORM/imap /usr/bin/imap From 64b8e016951266ac2acdc9893d0deaa800b3eb3e Mon Sep 17 00:00:00 2001 From: Fred Date: Tue, 17 Feb 2026 20:46:14 +0000 Subject: [PATCH 2/4] fix check command line --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f96c22f..8c5f038 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -52,6 +52,6 @@ jobs: uses: goreleaser/goreleaser-action@v6 with: version: '~> v2' - args: release check .goreleaser-docker-only.yml .goreleaser.yml + args: check .goreleaser-docker-only.yml .goreleaser.yml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 113bba35fe78e1bf14eaa7f629c3ab7637efeb20 Mon Sep 17 00:00:00 2001 From: Fred Date: Tue, 17 Feb 2026 20:58:14 +0000 Subject: [PATCH 3/4] run goreleaser check in separate job --- .github/workflows/build.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8c5f038..6131617 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -17,7 +17,6 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - name: Check out code into the Go module directory uses: actions/checkout@v5 @@ -48,6 +47,13 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} continue-on-error: true + goreleaser: + name: Check GoReleaser configurations + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v5 + - name: Check GoReleaser configurations uses: goreleaser/goreleaser-action@v6 with: From 01a5d3f821ebde2b9aa0c14ec2e431a1b6aaf91b Mon Sep 17 00:00:00 2001 From: Fred Date: Tue, 17 Feb 2026 21:02:46 +0000 Subject: [PATCH 4/4] add qemu step to release --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f60c7d..0717c8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,9 @@ jobs: go-version: ~1.25 check-latest: true + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Login to DockerHub uses: docker/login-action@v3 with: