tweak helpers
This commit is contained in:
@ -106,7 +106,7 @@ build-linux-qa:
|
|||||||
only:
|
only:
|
||||||
- web
|
- web
|
||||||
script:
|
script:
|
||||||
- BUILD_TAGS="build_qa pmapi_qa" make build
|
- BUILD_TAGS="build_qa" make build
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "bridge-linux-qa-$CI_COMMIT_SHORT_SHA"
|
name: "bridge-linux-qa-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
paths:
|
||||||
@ -150,7 +150,7 @@ build-darwin-qa:
|
|||||||
only:
|
only:
|
||||||
- web
|
- web
|
||||||
script:
|
script:
|
||||||
- BUILD_TAGS="build_qa pmapi_qa" make build
|
- BUILD_TAGS="build_qa" make build
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "bridge-darwin-qa-$CI_COMMIT_SHORT_SHA"
|
name: "bridge-darwin-qa-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
paths:
|
||||||
@ -198,7 +198,7 @@ build-windows-qa:
|
|||||||
- apt-get update && apt-get -y install binutils-mingw-w64 tar gzip
|
- apt-get update && apt-get -y install binutils-mingw-w64 tar gzip
|
||||||
- ln -s /usr/bin/x86_64-w64-mingw32-windres /usr/bin/windres
|
- ln -s /usr/bin/x86_64-w64-mingw32-windres /usr/bin/windres
|
||||||
- go mod download
|
- go mod download
|
||||||
- TARGET_OS=windows BUILD_TAGS="build_qa pmapi_qa" make build
|
- TARGET_OS=windows BUILD_TAGS="build_qa" make build
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "bridge-windows-qa-$CI_COMMIT_SHORT_SHA"
|
name: "bridge-windows-qa-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
20
Makefile
20
Makefile
@ -18,6 +18,7 @@ SRC_ICNS:=Bridge.icns
|
|||||||
SRC_SVG:=logo.svg
|
SRC_SVG:=logo.svg
|
||||||
TGT_ICNS:=Bridge.icns
|
TGT_ICNS:=Bridge.icns
|
||||||
EXE_NAME:=proton-bridge
|
EXE_NAME:=proton-bridge
|
||||||
|
CONFIGNAME:=bridge
|
||||||
ifeq "${TARGET_CMD}" "Import-Export"
|
ifeq "${TARGET_CMD}" "Import-Export"
|
||||||
APP_VERSION:=${IE_APP_VERSION}
|
APP_VERSION:=${IE_APP_VERSION}
|
||||||
SRC_ICO:=ie.ico
|
SRC_ICO:=ie.ico
|
||||||
@ -25,19 +26,24 @@ ifeq "${TARGET_CMD}" "Import-Export"
|
|||||||
SRC_SVG:=ie.svg
|
SRC_SVG:=ie.svg
|
||||||
TGT_ICNS:=ImportExport.icns
|
TGT_ICNS:=ImportExport.icns
|
||||||
EXE_NAME:=proton-ie
|
EXE_NAME:=proton-ie
|
||||||
|
CONFIGNAME:=importExport
|
||||||
endif
|
endif
|
||||||
REVISION:=$(shell git rev-parse --short=10 HEAD)
|
REVISION:=$(shell git rev-parse --short=10 HEAD)
|
||||||
BUILD_TIME:=$(shell date +%FT%T%z)
|
BUILD_TIME:=$(shell date +%FT%T%z)
|
||||||
|
|
||||||
BUILD_FLAGS:=-tags='${BUILD_TAGS}'
|
BUILD_FLAGS:=-tags='${BUILD_TAGS}'
|
||||||
|
BUILD_FLAGS_LAUNCHER:=${BUILD_FLAGS}
|
||||||
BUILD_FLAGS_NOGUI:=-tags='${BUILD_TAGS} nogui'
|
BUILD_FLAGS_NOGUI:=-tags='${BUILD_TAGS} nogui'
|
||||||
GO_LDFLAGS:=$(addprefix -X github.com/ProtonMail/proton-bridge/internal/constants.,Version=${APP_VERSION} Revision=${REVISION} BuildTime=${BUILD_TIME})
|
GO_LDFLAGS:=$(addprefix -X github.com/ProtonMail/proton-bridge/internal/constants.,Version=${APP_VERSION} Revision=${REVISION} BuildTime=${BUILD_TIME})
|
||||||
ifneq "${BUILD_LDFLAGS}" ""
|
ifneq "${BUILD_LDFLAGS}" ""
|
||||||
GO_LDFLAGS+= ${BUILD_LDFLAGS}
|
GO_LDFLAGS+=${BUILD_LDFLAGS}
|
||||||
endif
|
endif
|
||||||
GO_LDFLAGS:=-ldflags '${GO_LDFLAGS}'
|
GO_LDFLAGS_LAUNCHER:=${GO_LDFLAGS}
|
||||||
BUILD_FLAGS+= ${GO_LDFLAGS}
|
GO_LDFLAGS_LAUNCHER+=$(addprefix -X main.,ConfigName=${CONFIGNAME} ExeName=proton-${APP})
|
||||||
BUILD_FLAGS_NOGUI+= ${GO_LDFLAGS}
|
|
||||||
|
BUILD_FLAGS+=-ldflags '${GO_LDFLAGS}'
|
||||||
|
BUILD_FLAGS_NOGUI+=-ldflags '${GO_LDFLAGS}'
|
||||||
|
BUILD_FLAGS_LAUNCHER+=-ldflags '${GO_LDFLAGS_LAUNCHER}'
|
||||||
|
|
||||||
DEPLOY_DIR:=cmd/${TARGET_CMD}/deploy
|
DEPLOY_DIR:=cmd/${TARGET_CMD}/deploy
|
||||||
ICO_FILES:=
|
ICO_FILES:=
|
||||||
@ -81,13 +87,13 @@ build-ie-nogui:
|
|||||||
TARGET_CMD=Import-Export $(MAKE) build-nogui
|
TARGET_CMD=Import-Export $(MAKE) build-nogui
|
||||||
|
|
||||||
build-launcher:
|
build-launcher:
|
||||||
go build -tags='${BUILD_TAGS}' -ldflags="-X 'main.ConfigName=bridge' -X 'main.ExeName=proton-bridge'" -o launcher-bridge cmd/launcher/main.go
|
go build ${BUILD_FLAGS_LAUNCHER} -o launcher-${APP} cmd/launcher/main.go
|
||||||
|
|
||||||
build-launcher-ie:
|
build-launcher-ie:
|
||||||
go build -tags='${BUILD_TAGS}' -ldflags="-X 'main.ConfigName=importExport' -X 'main.ExeName=Import-Export'" -o launcher-ie cmd/launcher/main.go
|
TARGET_CMD=Import-Export $(MAKE) build-launcher
|
||||||
|
|
||||||
versioner:
|
versioner:
|
||||||
go build ${BUILD_FLAGS} ${GO_LDFLAGS} -o versioner utils/versioner/main.go
|
go build ${BUILD_FLAGS} -o versioner utils/versioner/main.go
|
||||||
|
|
||||||
hasher:
|
hasher:
|
||||||
go build -o hasher utils/hasher/main.go
|
go build -o hasher utils/hasher/main.go
|
||||||
|
|||||||
@ -40,6 +40,7 @@ func createApp() *cli.App { // nolint[funlen]
|
|||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "root",
|
Name: "root",
|
||||||
|
Aliases: []string{"C"},
|
||||||
Usage: "The root directory from which to begin recursive hashing",
|
Usage: "The root directory from which to begin recursive hashing",
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -166,12 +166,14 @@ func fetch(app, platform string) map[string]versionInfo {
|
|||||||
|
|
||||||
res, err := resty.New().R().Get(url)
|
res, err := resty.New().R().Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
println("fetch failed", err.Error())
|
||||||
return make(map[string]versionInfo)
|
return make(map[string]versionInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
var versionMap map[string]versionInfo
|
var versionMap map[string]versionInfo
|
||||||
|
|
||||||
if err := json.Unmarshal(res.Body(), &versionMap); err != nil {
|
if err := json.Unmarshal(res.Body(), &versionMap); err != nil {
|
||||||
|
println("unmarshal failed", err.Error())
|
||||||
return make(map[string]versionInfo)
|
return make(map[string]versionInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user