diff --git a/.github/workflows/image-publish.yaml b/.github/workflows/image-publish.yaml index cdc67bc..beab199 100644 --- a/.github/workflows/image-publish.yaml +++ b/.github/workflows/image-publish.yaml @@ -6,7 +6,7 @@ on: env: dockerhub_namespace: kloeckneri - manufacturer: kloeckner-i + manufacturer: db-operator product_name: db-auth-gateway go_version: "1.18" go_os: linux @@ -15,6 +15,8 @@ env: jobs: build: runs-on: ubuntu-latest + permissions: + packages: write strategy: matrix: include: @@ -49,12 +51,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Dockerhub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set action link variable run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV @@ -66,8 +62,6 @@ jobs: file: Dockerfile-ci platforms: ${{ env.go_os }}/${{ matrix.docker_arch }} tags: | - ${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest-${{ matrix.go_arch }} - ${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }}-${{ matrix.go_arch }} ghcr.io/${{ env.manufacturer }}/${{ env.product_name }}:latest-${{ matrix.go_arch }} ghcr.io/${{ env.manufacturer }}/${{ env.product_name }}:${{ github.event.release.tag_name }}-${{ matrix.go_arch }} labels: | @@ -79,6 +73,8 @@ jobs: push_to_ghcr: runs-on: ubuntu-latest needs: build + permissions: + packages: write steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -106,34 +102,3 @@ jobs: run: | docker manifest push ghcr.io/${{ env.manufacturer }}/${{ env.product_name }}:${{ github.event.release.tag_name }} docker manifest push ghcr.io/${{ env.manufacturer }}/${{ env.product_name }}:latest - - push_to_dockerhub: - runs-on: ubuntu-latest - needs: build - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Create a docker manifest for a versioned container - run: | - docker manifest create ${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }} \ - --amend ${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }}-amd64 \ - --amend ${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }}-arm64 - - - name: Create a manifest for the latest container - run: | - docker manifest create ${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest \ - --amend ${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest-amd64 \ - --amend ${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest-arm64 - - - name: Push the manifest - run: | - docker manifest push ${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }} - docker manifest push ${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest - diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index de4ef06..bf4570e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v2 - name: Check Code Style - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: version: v1.46.2 diff --git a/cmd/main.go b/cmd/main.go index 6dadc44..dc0bc97 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -24,9 +24,9 @@ import ( "syscall" "time" - pkg "github.com/kloeckner-i/db-auth-gateway/internal" - "github.com/kloeckner-i/db-auth-gateway/internal/api" - "github.com/kloeckner-i/db-auth-gateway/internal/config" + pkg "github.com/db-operator/db-auth-gateway/internal" + "github.com/db-operator/db-auth-gateway/internal/api" + "github.com/db-operator/db-auth-gateway/internal/config" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/go.mod b/go.mod index 4ee694e..6ddd7f9 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/kloeckner-i/db-auth-gateway +module github.com/db-operator/db-auth-gateway go 1.18 diff --git a/internal/api/api.go b/internal/api/api.go index 07a3bc1..727e63e 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -27,7 +27,7 @@ import ( "io/ioutil" "time" - "github.com/kloeckner-i/db-auth-gateway/internal/util" + "github.com/db-operator/db-auth-gateway/internal/util" "golang.org/x/oauth2" goauth "golang.org/x/oauth2/google" "google.golang.org/api/option" diff --git a/internal/config/config.go b/internal/config/config.go index cb40212..47a99de 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -29,8 +29,8 @@ import ( "sync" "time" - "github.com/kloeckner-i/db-auth-gateway/internal/api" - "github.com/kloeckner-i/db-auth-gateway/internal/pubkey" + "github.com/db-operator/db-auth-gateway/internal/api" + "github.com/db-operator/db-auth-gateway/internal/pubkey" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" log "github.com/sirupsen/logrus" diff --git a/internal/config/config_test.go b/internal/config/config_test.go index f54150b..d81ad1e 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/kloeckner-i/db-auth-gateway/internal/api" - "github.com/kloeckner-i/db-auth-gateway/internal/config" - "github.com/kloeckner-i/db-auth-gateway/internal/util" + "github.com/db-operator/db-auth-gateway/internal/api" + "github.com/db-operator/db-auth-gateway/internal/config" + "github.com/db-operator/db-auth-gateway/internal/util" "github.com/stretchr/testify/assert" "golang.org/x/oauth2" "google.golang.org/api/option" diff --git a/internal/gateway.go b/internal/gateway.go index f8c7a28..2737348 100644 --- a/internal/gateway.go +++ b/internal/gateway.go @@ -29,9 +29,9 @@ import ( "sync/atomic" "time" - "github.com/kloeckner-i/db-auth-gateway/internal/config" - "github.com/kloeckner-i/db-auth-gateway/internal/pubkey" - "github.com/kloeckner-i/db-auth-gateway/internal/util" + "github.com/db-operator/db-auth-gateway/internal/config" + "github.com/db-operator/db-auth-gateway/internal/pubkey" + "github.com/db-operator/db-auth-gateway/internal/util" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" log "github.com/sirupsen/logrus" diff --git a/internal/pubkey/authority_test.go b/internal/pubkey/authority_test.go index 49ab3d6..118e0bb 100644 --- a/internal/pubkey/authority_test.go +++ b/internal/pubkey/authority_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/kloeckner-i/db-auth-gateway/internal/pubkey" + "github.com/db-operator/db-auth-gateway/internal/pubkey" "github.com/stretchr/testify/assert" ) diff --git a/internal/pubkey/pubkey.go b/internal/pubkey/pubkey.go index cc7bad0..5b4b8e6 100644 --- a/internal/pubkey/pubkey.go +++ b/internal/pubkey/pubkey.go @@ -25,7 +25,7 @@ import ( "errors" "fmt" - "github.com/kloeckner-i/db-auth-gateway/internal/util" + "github.com/db-operator/db-auth-gateway/internal/util" log "github.com/sirupsen/logrus" ) diff --git a/internal/pubkey/pubkey_test.go b/internal/pubkey/pubkey_test.go index ba18de7..af8da5a 100644 --- a/internal/pubkey/pubkey_test.go +++ b/internal/pubkey/pubkey_test.go @@ -23,7 +23,7 @@ import ( "encoding/pem" "testing" - "github.com/kloeckner-i/db-auth-gateway/internal/pubkey" + "github.com/db-operator/db-auth-gateway/internal/pubkey" "github.com/stretchr/testify/assert" ) diff --git a/internal/util/util_test.go b/internal/util/util_test.go index 43dbd2b..d00420b 100644 --- a/internal/util/util_test.go +++ b/internal/util/util_test.go @@ -19,7 +19,7 @@ package util_test import ( "testing" - "github.com/kloeckner-i/db-auth-gateway/internal/util" + "github.com/db-operator/db-auth-gateway/internal/util" "github.com/stretchr/testify/assert" ) diff --git a/test/e2e_test.go b/test/e2e_test.go index 702307c..3bf02ad 100644 --- a/test/e2e_test.go +++ b/test/e2e_test.go @@ -32,8 +32,8 @@ import ( "time" _ "github.com/jackc/pgx/v4/stdlib" - "github.com/kloeckner-i/db-auth-gateway/internal/api" - "github.com/kloeckner-i/db-auth-gateway/internal/util" + "github.com/db-operator/db-auth-gateway/internal/api" + "github.com/db-operator/db-auth-gateway/internal/util" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "golang.org/x/oauth2"