mirror of
https://github.com/kopia/kopia.git
synced 2025-12-23 22:57:50 -05:00
ci: stop using goreleaser to produce macOS binaries, make universal binary as separate .tar.gz
This commit is contained in:
@@ -8,7 +8,6 @@ builds:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
- windows
|
||||
goarch:
|
||||
- amd64
|
||||
|
||||
14
Makefile
14
Makefile
@@ -96,12 +96,18 @@ build-current-os-with-ui: html-ui
|
||||
ifeq ($(GOOS)/$(CI),darwin/true)
|
||||
# build a fat binary that runs on both AMD64 and ARM64, this will be embedded in KopiaUI
|
||||
# and will run optimally on both architectures.
|
||||
GOARCH=arm64 go build $(KOPIA_BUILD_FLAGS) -o dist/kopia_darwin_arm64/.kopia-arm64 -tags embedhtml
|
||||
GOARCH=amd64 go build $(KOPIA_BUILD_FLAGS) -o dist/kopia_darwin_amd64/.kopia-amd64 -tags embedhtml
|
||||
lipo -create -output dist/kopia_darwin_$(GOARCH)/kopia dist/kopia_darwin_arm64/.kopia-arm64 dist/kopia_darwin_amd64/.kopia-amd64
|
||||
GOARCH=arm64 go build $(KOPIA_BUILD_FLAGS) -o dist/kopia_darwin_arm64/kopia -tags embedhtml
|
||||
GOARCH=amd64 go build $(KOPIA_BUILD_FLAGS) -o dist/kopia_darwin_amd64/kopia -tags embedhtml
|
||||
mkdir -p dist/kopia_darwin_universal
|
||||
lipo -create -output dist/kopia_darwin_universal/kopia dist/kopia_darwin_arm64/kopia dist/kopia_darwin_amd64/kopia
|
||||
ifneq ($(MACOS_SIGNING_IDENTITY),)
|
||||
codesign -v --keychain $(MACOS_KEYCHAIN) -s $(MACOS_SIGNING_IDENTITY) --force dist/kopia_$(GOOS)_$(GOARCH)/kopia$(exe_suffix)
|
||||
codesign -v --keychain $(MACOS_KEYCHAIN) -s $(MACOS_SIGNING_IDENTITY) --force dist/kopia_darwin_amd64/kopia
|
||||
codesign -v --keychain $(MACOS_KEYCHAIN) -s $(MACOS_SIGNING_IDENTITY) --force dist/kopia_darwin_arm/kopia
|
||||
codesign -v --keychain $(MACOS_KEYCHAIN) -s $(MACOS_SIGNING_IDENTITY) --force dist/kopia_darwin_universal/kopia
|
||||
endif
|
||||
tools/make-tgz.sh dist kopia-$(KOPIA_VERSION_NO_PREFIX)-macOS-x64 dist/kopia_darwin_amd64/kopia
|
||||
tools/make-tgz.sh dist kopia-$(KOPIA_VERSION_NO_PREFIX)-macOS-arm64 dist/kopia_darwin_arm64/kopia
|
||||
tools/make-tgz.sh dist kopia-$(KOPIA_VERSION_NO_PREFIX)-macOS-universal dist/kopia_darwin_universal/kopia
|
||||
else
|
||||
go build $(KOPIA_BUILD_FLAGS) -o dist/kopia_$(GOOS)_$(GOARCH)/kopia$(exe_suffix) -tags embedhtml
|
||||
endif
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
"category": "public.app-category.utilities",
|
||||
"extraResources": [
|
||||
{
|
||||
"from": "../dist/kopia_darwin_amd64",
|
||||
"from": "../dist/kopia_darwin_universal",
|
||||
"to": "server",
|
||||
"filter": [
|
||||
"kopia"
|
||||
|
||||
19
tools/make-tgz.sh
Executable file
19
tools/make-tgz.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
output_dir=$1
|
||||
basefname=$2
|
||||
binary_file=$3
|
||||
|
||||
|
||||
temp_dir=$(mktemp -d)
|
||||
staging_dir="$temp_dir/$basefname"
|
||||
mkdir -p "$staging_dir"
|
||||
cp $binary_file $staging_dir
|
||||
cp LICENSE $staging_dir
|
||||
cp README.md $staging_dir
|
||||
tar -C $temp_dir -cvz $basefname > $output_dir/$basefname.tar.gz
|
||||
rm -rf "$temp_dir"
|
||||
|
||||
#rm -rf $output_file.staging
|
||||
#mkdir -vp $output_file.staging/$bn
|
||||
# cp -v $output_file
|
||||
Reference in New Issue
Block a user