-
Notifications
You must be signed in to change notification settings - Fork 163
59 lines (46 loc) · 1.1 KB
/
ci.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
name: CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Lint
uses: golangci/golangci-lint-action@v4
- name: Validate Go modules
run: ./scripts/validate
- name: Test
run: ./scripts/test
- name: Get Tag
if: startsWith(github.ref, 'refs/tags/v')
run: echo "GITHUB_TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV
- name: Build
env:
CROSS: 1
run: ./scripts/build
- name: Package
run: |
./scripts/package
ls -lR dist/artifacts
# Stage binary for packaging step
cp -r ./bin/* ./package/
- name: Docker Build
uses: docker/build-push-action@v5
with:
push: false
context: package
tags: rancher/cli2:$GITHUB_TAG
fossa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.fossaApiKey }}