This commit is contained in:
53
.woodpecker/release.yml
Normal file
53
.woodpecker/release.yml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
when:
|
||||||
|
- event: tag
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build-release-assets
|
||||||
|
image: golang:1.25
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
version="${CI_COMMIT_TAG}"
|
||||||
|
dist="dist"
|
||||||
|
pkg="gitea.maximumdirect.net/eric/seriatim/cmd/seriatim"
|
||||||
|
|
||||||
|
rm -rf "$dist"
|
||||||
|
mkdir -p "$dist"
|
||||||
|
|
||||||
|
build_binary() {
|
||||||
|
goos="$1"
|
||||||
|
goarch="$2"
|
||||||
|
suffix="$3"
|
||||||
|
output="$dist/seriatim_${version}_${goos}_${goarch}${suffix}"
|
||||||
|
|
||||||
|
CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" \
|
||||||
|
go build -trimpath -ldflags "-s -w -X gitea.maximumdirect.net/eric/seriatim/internal/buildinfo.Version=${version}" \
|
||||||
|
-o "$output" "$pkg"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_binary linux amd64 ""
|
||||||
|
build_binary linux arm64 ""
|
||||||
|
build_binary darwin amd64 ""
|
||||||
|
build_binary darwin arm64 ""
|
||||||
|
build_binary windows amd64 ".exe"
|
||||||
|
build_binary windows arm64 ".exe"
|
||||||
|
|
||||||
|
(
|
||||||
|
cd "$dist"
|
||||||
|
sha256sum seriatim_* > SHA256SUMS
|
||||||
|
)
|
||||||
|
|
||||||
|
- name: publish-release
|
||||||
|
image: woodpeckerci/plugin-release
|
||||||
|
depends_on:
|
||||||
|
- build-release-assets
|
||||||
|
settings:
|
||||||
|
api_key:
|
||||||
|
from_secret: GITEA_RELEASE_TOKEN
|
||||||
|
files:
|
||||||
|
- dist/seriatim_*
|
||||||
|
- dist/SHA256SUMS
|
||||||
|
file-exists: skip
|
||||||
|
overwrite: false
|
||||||
|
prerelease: false
|
||||||
Reference in New Issue
Block a user