From 00f0e930d94a27357f4e754abb066b070614c3d9 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Thu, 5 May 2022 09:45:46 +0200 Subject: [PATCH 1/2] Configure the github release action for private go modules - cluster-controller (private repo) was introduced as a go dep and we need to do the classic git hacks to allow go mod to read the new private repo dependency --- .github/workflows/build.yaml | 5 ----- .github/workflows/release.yaml | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 265ea17..102825b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,11 +20,6 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - - name: Configure git for private modules - env: - GITHUB_BUILD_USERNAME: ${{ secrets.BUILD_BOT_USER }} - GITHUB_BUILD_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }} - run: git config --global url."https://${GITHUB_BUILD_USERNAME}:${GITHUB_BUILD_TOKEN}@github.com".insteadOf "https://github.com" - name: Build docker image env: GITHUB_BUILD_USERNAME: ${{ secrets.BUILD_BOT_USER }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6b044d9..16c362b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,6 +2,9 @@ on: push: tags: [v*.*.*] +env: + GOPRIVATE: github.com/weaveworks/cluster-controller + name: release jobs: build: @@ -17,6 +20,9 @@ jobs: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - name: Build docker image + env: + GITHUB_BUILD_USERNAME: ${{ secrets.BUILD_BOT_USER }} + GITHUB_BUILD_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }} run: | make docker-build - name: Login to Docker Hub From f9d8ec822725383e07c8b1b12aca75fa3d938e3b Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Thu, 5 May 2022 09:49:14 +0200 Subject: [PATCH 2/2] Configure docker host's git for private go modules too --- .github/workflows/build.yaml | 5 +++++ .github/workflows/release.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 102825b..265ea17 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,6 +20,11 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} + - name: Configure git for private modules + env: + GITHUB_BUILD_USERNAME: ${{ secrets.BUILD_BOT_USER }} + GITHUB_BUILD_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }} + run: git config --global url."https://${GITHUB_BUILD_USERNAME}:${GITHUB_BUILD_TOKEN}@github.com".insteadOf "https://github.com" - name: Build docker image env: GITHUB_BUILD_USERNAME: ${{ secrets.BUILD_BOT_USER }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 16c362b..e473f70 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -19,6 +19,11 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} + - name: Configure git for private modules + env: + GITHUB_BUILD_USERNAME: ${{ secrets.BUILD_BOT_USER }} + GITHUB_BUILD_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }} + run: git config --global url."https://${GITHUB_BUILD_USERNAME}:${GITHUB_BUILD_TOKEN}@github.com".insteadOf "https://github.com" - name: Build docker image env: GITHUB_BUILD_USERNAME: ${{ secrets.BUILD_BOT_USER }}