aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tews <michael@tews.dev>2026-03-31 05:42:59 +0200
committerMichael Tews <michael@tews.dev>2026-03-31 05:42:59 +0200
commit752c8e80d528cb17fbe129ade4234e571a36354d (patch)
tree5fccec18bdbe4cadfe2d6bab4b2ad5e564ea5d1f
parent24f05d49a06c790992ed08d8be0ebd56e1cd1e9d (diff)
build: windows and macos binariesbuild/windows-macos-binaries
-rw-r--r--.github/workflows/release-please.yml7
-rw-r--r--magefile.go44
2 files changed, 46 insertions, 5 deletions
diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml
index 023bad2..2556085 100644
--- a/.github/workflows/release-please.yml
+++ b/.github/workflows/release-please.yml
@@ -47,5 +47,10 @@ jobs:
fail_on_unmatched_files: true
tag_name: ${{ needs.release-please.outputs.tag_name }}
files: |
- build/rclone-studip
+ build/rclone-studip-darwin-amd64
+ build/rclone-studip-darwin-arm64
+ build/rclone-studip-linux-amd64
+ build/rclone-studip-linux-arm64
+ build/rclone-studip-windows-amd64.exe
+ build/rclone-studip-windows-arm64.exe
build/librcloneplugin_backend_studip.so
diff --git a/magefile.go b/magefile.go
index a7fcdc0..506252b 100644
--- a/magefile.go
+++ b/magefile.go
@@ -243,12 +243,48 @@ func Standalone() error {
return fmt.Errorf("create output dir %q: %w", outputDir, err)
}
- return runCommandWithEnv(
- []string{"GOEXPERIMENT=" + goExperiment},
- "go", "build", "-o", binaryOutputPath(), ".",
- )
+ type target struct {
+ goos string
+ goarch string
+ }
+
+ targets := []target{
+ {goos: "linux", goarch: "amd64"},
+ {goos: "linux", goarch: "arm64"},
+ {goos: "windows", goarch: "amd64"},
+ {goos: "windows", goarch: "arm64"},
+ {goos: "darwin", goarch: "amd64"},
+ {goos: "darwin", goarch: "arm64"},
+ }
+
+ for _, t := range targets {
+ out := binaryOutputPathFor(t.goos, t.goarch)
+
+ env := []string{
+ "GOEXPERIMENT=" + goExperiment,
+ "GOOS=" + t.goos,
+ "GOARCH=" + t.goarch,
+ "CGO_ENABLED=0",
+ }
+
+ if err := runCommandWithEnv(
+ env,
+ "go", "build", "-o", out, ".",
+ ); err != nil {
+ return fmt.Errorf("build %s/%s: %w", t.goos, t.goarch, err)
+ }
+ }
+
+ return nil
}
+func binaryOutputPathFor(goos, goarch string) string {
+ name := fmt.Sprintf("rclone-studip-%s-%s", goos, goarch)
+ if goos == "windows" {
+ name += ".exe"
+ }
+ return filepath.Join(outputDir, name)
+}
func RunStandalone(args ...string) error {
if err := Standalone(); err != nil {
return err