-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot.yml
55 lines (49 loc) · 1.35 KB
/
dot.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
stages:
- test
- security
- build
jobs:
- name: Run tests
stage: test
image: "docker.io/golang:1.21.3"
variables:
- TEST: false
script:
- go test ./...
condition: TEST
- name: Run checks
stage: security
image: "docker.io/golangci/golangci-lint:latest"
script:
- golangci-lint run ./...
# - name: Run GoSec
# stage: security
# image: "docker.io/securego/gosec:latest"
# entrypoint: ["/bin/sh", "-c"]
# script:
# - gosec --help
# - name: Build using Goreleaser
# stage: build
# image: "docker.io/golang:1.21.3-bookworm"
# script:
# - git config --global safe.directory '*'
# - curl -sfL https://goreleaser.com/static/run | bash -s -- build --snapshot
# artifacts:
# - dist
- name: Build job linux
stage: build
image: "docker.io/golang:1.21.3-bookworm"
script:
- git config --global safe.directory '*'
- export VERSION=$(git describe --always)
- export BUILDDATE=$(date)
- export COMMIT=$(git log --format="%H" -n 1)
- echo $BUILDDATE
- |
go build -o dot \
-ldflags="-X 'github.com/opnlabs/dot/cmd/dot.version=$VERSION' \
-X 'github.com/opnlabs/dot/cmd/dot.builddate=$BUILDDATE' \
-X 'github.com/opnlabs/dot/cmd/dot.commit=$COMMIT'" \
main.go
artifacts:
- dot