Files
RawMark/scripts/ci-package.sh
T
eezd 525fa51b19
Development CI / check-and-package (push) Successful in 3m52s
GitHub Git mirror / mirror (push) Successful in 5s
Main CI / check-and-package (pull_request) Successful in 3m51s
Development CI / image (push) Successful in 20s
Main CI / image (pull_request) Successful in 12s
Development CI / deploy-development (push) Successful in 5s
feat(ci): adapt formal releases and MAIN deployment
2026-10-30 10:54:07 +08:00

30 lines
1.2 KiB
Bash

#!/bin/sh
# Package the same binaries used by native and container smoke tests.
set -eu
mode="${1:?Expected development or release}"
case "$mode" in
development) targets='linux/amd64' ;;
release) targets='linux/amd64 linux/arm64 windows/amd64 windows/arm64 darwin/amd64 darwin/arm64' ;;
*) exit 2 ;;
esac
export RAWMARK_BUILD_CHANNEL="$mode"
export RAWMARK_BUILD_VERSION="$(python3 scripts/release.py version)"
export CGO_ENABLED=0
mkdir -p package/licenses downloads
cp LICENSE package/
cp web/LICENSE package/licenses/vue3-starter-MIT.txt
cp web/src/common/appearance/fonts/*-OFL.txt package/licenses/
cp web/src/common/appearance/fonts/maple/LICENSE.txt package/licenses/Maple-Mono-OFL.txt
for target in $targets; do
export GOOS="${target%/*}" GOARCH="${target#*/}"
extension=''
if [ "$GOOS" = windows ]; then extension='.exe'; fi
rm -f package/rawmark package/rawmark.exe
go vet ./...
go build -trimpath -ldflags="-s -w -X main.releaseVersion=$(python3 scripts/release.py version)" \
-o "package/rawmark$extension" ./cmd/rawmark
if [ "$target" = linux/amd64 ]; then python3 scripts/smoke-release.py package/rawmark; fi
python3 scripts/package-release.py "$GOOS" "$GOARCH"
done
python3 scripts/release.py bundle "$mode"