File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ name : release-latest
2+
3+ on :
4+ push :
5+ branches :
6+ - trunk
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ build-and-release :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v4
18+
19+ - name : Setup Go
20+ uses : actions/setup-go@v5
21+ with :
22+ go-version-file : go.mod
23+
24+ - name : Build linux amd64 binary
25+ run : |
26+ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \
27+ go build \
28+ -trimpath \
29+ -ldflags "-s -w -X 'github.com/dector/ror/internal/env.version=latest' -X 'github.com/dector/ror/internal/env.commit=${GITHUB_SHA}' -X 'github.com/dector/ror/internal/env.time=$(date -u +%Y-%m-%dT%H:%M:%SZ)'" \
30+ -o ./ror \
31+ ./cmd/ror
32+
33+ tar -czf ror-linux-amd64.tar.gz ror
34+
35+ - name : Replace latest release
36+ env :
37+ GH_TOKEN : ${{ github.token }}
38+ run : |
39+ if gh release view latest >/dev/null 2>&1; then
40+ gh release delete latest --cleanup-tag --yes
41+ fi
42+
43+ gh release create latest \
44+ ror-linux-amd64.tar.gz \
45+ --title "latest" \
46+ --notes "Automated build from ${GITHUB_SHA}" \
47+ --latest
You can’t perform that action at this time.
0 commit comments