File tree Expand file tree Collapse file tree 2 files changed +100
-0
lines changed Expand file tree Collapse file tree 2 files changed +100
-0
lines changed Original file line number Diff line number Diff line change 1+ VERSION 0.8
2+
3+ deps :
4+ FROM golang:1.23.0-alpine3.19
5+
6+ WORKDIR /work
7+
8+ RUN apk add git file
9+
10+ RUN mkdir -p /go/cache && mkdir -p /go/modcache
11+ ENV GOCACHE= /go/cache
12+ ENV GOMODCACHE= /go/modcache
13+ CACHE --persist --sharing shared /go
14+
15+ COPY ../lib/project+src/src /lib/project
16+ COPY ../lib/tools+src/src /lib/tools
17+
18+ COPY go.mod go.sum .
19+ RUN go mod download
20+
21+ src :
22+ FROM +deps
23+
24+ CACHE --persist --sharing shared /go
25+
26+ COPY . .
27+ RUN go generate ./...
28+
29+ check :
30+ FROM +src
31+
32+ RUN gofmt -l . | grep . && exit 1 || exit 0
33+ RUN go vet ./...
34+
35+ build :
36+ FROM +src
37+
38+ ARG GOOS
39+ ARG GOARCH
40+ ARG version= "0.0.0"
41+
42+ ENV CGO_ENABLED= 0
43+ RUN go build -ldflags = "-extldflags=-static -X main.version=$version" -o bin/gh-job-checker main.go
44+ RUN file bin/gh-job-checker
45+
46+ SAVE ARTIFACT bin/gh-job-checker gh-job-checker
47+
48+ test :
49+ FROM +build
50+
51+ RUN go test ./...
52+
53+ github :
54+ FROM scratch
55+
56+ ARG version= "dev"
57+
58+ ARG TARGETOS
59+ ARG TARGETARCH
60+ ARG USERPLATFORM
61+
62+ COPY \
63+ --platform = $USERPLATFORM \
64+ (+build/gh-job-checker \
65+ --GOOS = $TARGETOS \
66+ --GOARCH = $TARGETARCH \
67+ --version = $version ) bin/gh-job-checker
68+
69+ SAVE ARTIFACT bin/gh-job-checker gh-job-checker
Original file line number Diff line number Diff line change 1+ version : " 1.0 "
2+ project : {
3+ name : " gh-job-checker "
4+ ci : targets : {
5+ github : {
6+ args : {
7+ version : string | * " dev " @forge (name =" GIT_TAG " )
8+ }
9+ platforms : [
10+ " linux/amd64 " ,
11+ " linux/arm64 " ,
12+ " darwin/amd64 " ,
13+ " darwin/arm64 " ,
14+ ]
15+ }
16+ test : retries : 3
17+ }
18+ release : {
19+ github : {
20+ on : tag : {}
21+ config : {
22+ name : string | * " dev " @forge (name =" GIT_TAG " )
23+ prefix : project .name
24+ token : {
25+ provider : " env "
26+ path : " GITHUB_TOKEN "
27+ }
28+ }
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments