forked from vmware-samples/vcenter-event-broker-appliance
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (84 loc) · 2.94 KB
/
router-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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: 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
workdir: vmware-event-router
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive run artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
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
env:
KO_DOCKER_REPO: us.gcr.io/daisy-284300/veba # .../router@sha256:
steps:
- 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 }}
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
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@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: release
path: |
./vmware-event-router/release.yaml
retention-days: 1