From 4252cc9e309ffe5f72d1ff401dacad7904cfb568 Mon Sep 17 00:00:00 2001 From: Michael Gasch <15986659+embano1@users.noreply.github.com> Date: Sat, 1 Jul 2023 08:00:39 +0200 Subject: [PATCH] fix: workflows Update goreleaser configuration Reorder checkout steps to make correct use of caching Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/gcr-dev-image.yml | 4 ++-- .github/workflows/gcr-prerelease-image.yml | 4 ++-- .github/workflows/release.yml | 6 +++--- .github/workflows/router-build.yml | 16 ++++++++-------- vmware-event-router/.goreleaser.yaml | 5 ----- 6 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1ca7b806..112a6508 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,10 +13,10 @@ name: "CodeQL" on: push: - branches: [main] + branches: [main,master] pull_request: # The branches below must be a subset of the branches above - branches: [main] + branches: [main,master] schedule: - cron: "34 21 * * 5" diff --git a/.github/workflows/gcr-dev-image.yml b/.github/workflows/gcr-dev-image.yml index 0cde4210..e6856769 100644 --- a/.github/workflows/gcr-dev-image.yml +++ b/.github/workflows/gcr-dev-image.yml @@ -29,6 +29,8 @@ jobs: PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - name: Setup ko uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6 @@ -38,8 +40,6 @@ jobs: go-version: ${{ matrix.go-version }} id: go - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - id: login_to_gcp uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033 with: diff --git a/.github/workflows/gcr-prerelease-image.yml b/.github/workflows/gcr-prerelease-image.yml index 8f05f41f..e67b1c27 100644 --- a/.github/workflows/gcr-prerelease-image.yml +++ b/.github/workflows/gcr-prerelease-image.yml @@ -24,6 +24,8 @@ jobs: PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - name: Setup ko uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6 @@ -33,8 +35,6 @@ jobs: go-version: ${{ matrix.go-version }} id: go - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - id: login_to_gcp uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d5c755d0..32e86fa3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: - name: GoReleaser uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 with: - args: release --rm-dist --release-notes RELEASE_CHANGELOG.md + args: release --clean --release-notes RELEASE_CHANGELOG.md workdir: vmware-event-router env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -111,6 +111,8 @@ jobs: runs-on: ${{ matrix.platform }} steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - name: Setup ko uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6 @@ -120,8 +122,6 @@ jobs: go-version: ${{ matrix.go-version }} id: go - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - id: login_to_gcp uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033 with: diff --git a/.github/workflows/router-build.yml b/.github/workflows/router-build.yml index 27ec3fd5..bacbf81d 100644 --- a/.github/workflows/router-build.yml +++ b/.github/workflows/router-build.yml @@ -29,20 +29,20 @@ jobs: timeout-minutes: 20 steps: + - name: Check out code + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: ${{ matrix.go-version }} id: go - - name: Check out code - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - name: GoReleaser Snapshot uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 with: version: latest - args: release --rm-dist --snapshot + args: release --clean --snapshot workdir: vmware-event-router env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -52,7 +52,7 @@ jobs: with: name: dist path: | - vmware-event-router/dist/router_Linux_*.tar.gz + vmware-event-router/dist/router_linux_*.tar.gz vmware-event-router/dist/checksums.txt retention-days: 1 @@ -69,6 +69,9 @@ jobs: KO_DOCKER_REPO: us.gcr.io/daisy-284300/veba # .../router@sha256: steps: + - name: Check out code + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - name: Setup ko uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6 @@ -78,9 +81,6 @@ jobs: go-version: ${{ matrix.go-version }} id: go - - name: Check out code - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - name: Get short COMMIT and TAG run: | echo "KO_COMMIT=$(echo -n $GITHUB_SHA | cut -c -8)" >> $GITHUB_ENV diff --git a/vmware-event-router/.goreleaser.yaml b/vmware-event-router/.goreleaser.yaml index 6cda140a..281f4872 100644 --- a/vmware-event-router/.goreleaser.yaml +++ b/vmware-event-router/.goreleaser.yaml @@ -20,11 +20,6 @@ archives: builds: - router name_template: "router_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" - replacements: &replacements - darwin: Darwin - linux: Linux - windows: Windows - amd64: x86_64 format_overrides: - goos: windows format: zip