-
Notifications
You must be signed in to change notification settings - Fork 4
83 lines (78 loc) · 2.36 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
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
name: build
on:
push:
branches-ignore:
- "release-please-*"
tags-ignore:
- "v*.*.*"
jobs:
build:
permissions:
contents: write
packages: write
strategy:
matrix:
target_os: ["linux", "darwin", "windows"]
target_arch: ["amd64", "arm64"]
runs-on: ubuntu-latest
env:
REMOTE_CACHE: "ghcr.io/${{ github.repository_owner }}/earthly-cache"
EARTHLY_MAX_REMOTE_CACHE: true
EARTHLY_PUSH: true
EARTHLY_CI: true
steps:
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Earthly
uses: earthly/actions-setup@v1
- name: +build ${{ matrix.target_os }}/${{ matrix.target_arch }}
run: |
export EARTHLY_REMOTE_CACHE="${{ env.REMOTE_CACHE }}:$(basename ${{ github.repository }})"
earthly +build --TARGET_OS=${{ matrix.target_os }} --TARGET_ARCH=${{ matrix.target_arch }}
lint:
permissions:
actions: write
contents: write
packages: write
runs-on: ubuntu-latest
env:
REMOTE_CACHE: "ghcr.io/${{ github.repository_owner }}/earthly-cache"
EARTHLY_MAX_REMOTE_CACHE: true
EARTHLY_CI: true
EARTHLY_PUSH: true
steps:
# - name: Login to ghcr.io
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: setup-go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: "-c ./.golangci-lint.yml"
# - name: Setup Earthly
# uses: earthly/actions-setup@v1
# - name: earthly +lint
# run: |
# export EARTHLY_REMOTE_CACHE="${{ env.REMOTE_CACHE }}:$(basename ${{ github.repository }})"
# earthly -a +lint/lint-report.xml ./lint-report.xml
# - name: Report
# if: always()
# uses: mikepenz/action-junit-report@v3
# with:
# report_paths: lint-report.xml
# annotate_only: true
# detailed_summary: true