Skip to content

Commit

Permalink
fix: workflows
Browse files Browse the repository at this point in the history
Update goreleaser configuration

Reorder checkout steps to make correct use of caching

Signed-off-by: Michael Gasch <[email protected]>
  • Loading branch information
embano1 committed Jul 1, 2023
1 parent 1e5cd23 commit c4f5591
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/gcr-dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ jobs:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- id: login_to_gcp
uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/gcr-prerelease-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ jobs:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- id: login_to_gcp
uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum

- name: Create CHANGELOG for Release
env:
Expand All @@ -46,7 +47,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 }}
Expand Down Expand Up @@ -111,17 +112,18 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- id: login_to_gcp
uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033
with:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/router-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@ 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 }}
cache-dependency-path: vmware-event-router/go.sum
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 }}
Expand All @@ -52,7 +53,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

Expand All @@ -69,18 +70,19 @@ 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

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
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
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/router-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,20 @@ jobs:
timeout-minutes: 15

steps:
- name: Check out code onto GOPATH
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
fetch-depth: 1

- name: Set up Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: 1.19
cache-dependency-path: vmware-event-router/go.sum

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Check out code onto GOPATH
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
fetch-depth: 1

- name: Get short COMMIT and TAG (used by ko)
run: |
echo "KO_COMMIT=$(echo -n $GITHUB_SHA | cut -c -8)" >> $GITHUB_ENV
Expand Down Expand Up @@ -139,6 +140,7 @@ jobs:
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: 1.19
cache-dependency-path: vmware-event-router/go.sum

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/router-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ jobs:
timeout-minutes: 20

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: golangci-lint
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/router-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ jobs:
timeout-minutes: 10

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 }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Install tparse
run: go install github.com/mfridman/tparse@latest

Expand Down
5 changes: 0 additions & 5 deletions vmware-event-router/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c4f5591

Please sign in to comment.