VMware Event Router Build Verification #671
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: VMware Event Router Build Verification | |
# triggered on every PRs to verify builds but only when changes inside | |
# vmware-event-router (sub)dir(s) | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'vmware-event-router/**' | |
schedule: | |
# runs daily | |
- cron: '0 0 * * *' | |
# run all jobs with these defaults, unless specified otherwise | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./vmware-event-router | |
jobs: | |
binaries: | |
name: Build binaries | |
strategy: | |
matrix: | |
go-version: ["1.19"] | |
platform: ["ubuntu-latest"] | |
runs-on: ${{ matrix.platform }} | |
timeout-minutes: 20 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- name: Set up Go ${{ matrix.go-version }} | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache-dependency-path: vmware-event-router/go.sum | |
id: go | |
- name: GoReleaser Snapshot | |
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 | |
with: | |
version: latest | |
args: release --clean --snapshot | |
workdir: vmware-event-router | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Archive run artifacts | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
with: | |
name: dist | |
path: | | |
vmware-event-router/dist/router_linux_*.tar.gz | |
vmware-event-router/dist/checksums.txt | |
retention-days: 1 | |
image: | |
name: Verify Release ko artifact (no upload) | |
strategy: | |
matrix: | |
go-version: ["1.19"] | |
platform: ["ubuntu-latest"] | |
runs-on: ${{ matrix.platform }} | |
timeout-minutes: 20 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- name: Setup ko | |
uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa | |
- name: Set up Go ${{ matrix.go-version }} | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache-dependency-path: vmware-event-router/go.sum | |
id: go | |
- name: Get short COMMIT and TAG | |
run: | | |
echo "KO_COMMIT=$(echo -n $GITHUB_SHA | cut -c -8)" >> $GITHUB_ENV | |
echo "KO_TAG=$(basename "${{ github.ref }}")" >> $GITHUB_ENV | |
- name: Build image (no push) | |
run: | | |
# build, push and create release YAML | |
ko resolve --platform=linux/arm64,linux/amd64 --push=false --tags ${KO_TAG},${KO_COMMIT},latest -BRf deploy/event-router-k8s.yaml > release.yaml | |
- name: Archive run artifacts | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
with: | |
name: release | |
path: | | |
./vmware-event-router/release.yaml | |
retention-days: 1 |