-
Notifications
You must be signed in to change notification settings - Fork 10
70 lines (60 loc) · 1.79 KB
/
artifacts.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
name: Artifacts
on:
pull_request:
branches: [ master, development ]
jobs:
compile:
name: Cross compile binaries
runs-on: ubuntu-latest
container:
image: golangci/golangci-lint:latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Make repo safe
run: git config --global --add safe.directory /__w/SOARCA/SOARCA
- name: Install swaggo
run: go install github.com/swaggo/swag/cmd/swag@latest
- name: Build with make
run: |
go install github.com/swaggo/swag/cmd/swag@latest
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest
make compile
make sbom
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
path: bin/*
retention-days: 1
docker-build:
needs: compile
name: Build docker image
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Make repo safe
run: git config --global --add safe.directory /__w/SOARCA/SOARCA
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download bin
uses: actions/download-artifact@v4
with:
pattern: ${{ github.sha }}
- name: Move files to bin folder
run: |
mkdir -p bin
mv ${{ github.sha }}/* ./bin/
chmod +x bin/soarca-*
- name: Build image
run: |
export VERSION=$(git describe --tags --dirty)
echo $VERSION
docker build --build-arg VERSION -t $VERSION .