mirror of
https://github.com/maputnik/editor.git
synced 2026-05-25 09:27:27 +00:00
66c5a5c953
Previously the desktop build lived in a separate repo and had to download a released version of the maputnik editor source code. Now that both live in the same repo, the desktop version can simply run the maputnik build command and use those generated files. This commit also removes the ci-desktop workflow, which is not needed. The regular ci workflow already built the desktop version (this commit also fixes that build). Fixes #919 If this works for you all, it would be lovely to create a new tag or release on GitHub for two reasons: 1. So the latest binaries are easier to locate, and 2. So I can update my [submission to homebrew](https://github.com/Homebrew/homebrew-core/commit/6e536ff007ef0bea5a3591af5678eb3152908cc9) to make installation easier (for os x users at least)
40 lines
1.2 KiB
Makefile
40 lines
1.2 KiB
Makefile
SOURCEDIR=.
|
|
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
|
|
BINARY=maputnik
|
|
DESKTOP_VERSION := 1.1.1
|
|
EDITOR_VERSION := $(shell node -p "require('../package.json').version")
|
|
GOPATH := $(if $(GOPATH),$(GOPATH),$(HOME)/go)
|
|
GOBIN := $(if $(GOBIN),$(GOBIN),$(HOME)/go/bin)
|
|
|
|
all: $(BINARY)
|
|
|
|
$(BINARY): $(GOBIN)/gox $(SOURCES) version.go rice-box.go
|
|
$(GOBIN)/gox -osarch "windows/amd64 linux/amd64 darwin/amd64" -output "bin/{{.OS}}/${BINARY}"
|
|
|
|
# Copy the current release into ./editor/maputnik so it can be
|
|
# embedded in the binary
|
|
editor/pull_release:
|
|
mkdir -p editor
|
|
cp -r ../dist/* editor
|
|
|
|
$(GOBIN)/gox:
|
|
go install github.com/mitchellh/gox@v1.0.1
|
|
|
|
$(GOBIN)/rice:
|
|
go install github.com/GeertJohan/go.rice/rice@v1.0.3
|
|
|
|
# Embed the current version numbers in the executable by writing version.go
|
|
.PHONY: version.go
|
|
version.go:
|
|
@echo "// DO NOT EDIT: Autogenerated by Makefile\n" > version.go
|
|
@echo "package main\n" >> version.go
|
|
@echo "const DesktopVersion = \"$(DESKTOP_VERSION)\"" >> version.go
|
|
@echo "const EditorVersion = \"$(EDITOR_VERSION)\"" >> version.go
|
|
|
|
rice-box.go: $(GOBIN)/rice editor/pull_release
|
|
$(GOBIN)/rice embed-go
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf editor && rm -f rice-box.go && rm -rf bin
|