-
Notifications
You must be signed in to change notification settings - Fork 22
47 lines (46 loc) · 1.19 KB
/
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
name: Build
on:
workflow_call:
pull_request:
push:
branches:
- umee
- release/**
# This workflow makes amd64 and arm64 binaries for macOS and Linux.
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
targetos: [darwin, linux]
name: price-feeder ${{ matrix.arch }} for ${{ matrix.targetos }}
steps:
- uses: actions/checkout@v3
- name: Cache binaries
id: cache-binaries
uses: actions/cache@v3
with:
path: ./cmd
key: price-feeder-${{ matrix.targetos }}-${{ matrix.arch }}
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Setup go
if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF
uses: actions/setup-go@v3
with:
go-version: 1.19
cache: true
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
- name: Compile
if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF
run: |
go mod download
cd cmd
go build .