Add static build with e2ee

This commit is contained in:
Tulir Asokan 2020-05-08 17:29:29 +03:00
parent e1b38bb202
commit ba4efc6411
3 changed files with 11 additions and 30 deletions

View File

@ -1,41 +1,20 @@
build: build:
stage: build
image: debian:bullseye
cache:
paths:
- .cache
before_script:
- apt-get update
- apt-get install -y git libolm-dev golang-go
- mkdir -p .cache
- export GOPATH="$CI_PROJECT_DIR/.cache"
script:
- go build -o gomuks_linux_amd64
artifacts:
paths:
- gomuks_linux_amd64
build_static:
stage: build stage: build
image: golang:alpine image: golang:alpine
cache: cache:
paths: paths:
- .cache - .cache
before_script: before_script:
- apk add --no-cache git build-base
- mkdir -p .cache - mkdir -p .cache
- export GOPATH="$CI_PROJECT_DIR/.cache" - export GOPATH="$CI_PROJECT_DIR/.cache"
variables:
CGO_ENABLED: "0"
script: script:
- GOOS=linux GOARCH=amd64 go build -o gomuks_linux_amd64 - git clone https://gitlab.matrix.org/matrix-org/olm.git
- GOOS=linux GOARCH=386 go build -o gomuks_linux_386 - cd olm
- GOOS=linux GOARCH=arm go build -o gomuks_linux_arm - CFLAGS=-static-libgcc CPPFLAGS="-static-libgcc -static-libstdc++" make static
- GOOS=linux GOARCH=arm64 go build -o gomuks_linux_arm64 - cp build/libolm.a /usr/lib/ && cp -a include/olm/ /usr/include/
- GOOS=darwin GOARCH=amd64 go build -o gomuks_darwin_amd64 - cd ..
- go build -ldflags "-linkmode external -extldflags -static" -o gomuks
artifacts: artifacts:
paths: paths:
- gomuks_linux_amd64 - gomuks
- gomuks_linux_386
- gomuks_linux_arm
- gomuks_linux_arm64
- gomuks_darwin_amd64

2
go.mod
View File

@ -21,7 +21,7 @@ require (
golang.org/x/net v0.0.0-20200505041828-1ed23360d12c golang.org/x/net v0.0.0-20200505041828-1ed23360d12c
gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2
gopkg.in/yaml.v2 v2.2.8 gopkg.in/yaml.v2 v2.2.8
maunium.net/go/mautrix v0.3.3 maunium.net/go/mautrix v0.3.4
maunium.net/go/mauview v0.1.1 maunium.net/go/mauview v0.1.1
maunium.net/go/tcell v0.2.0 maunium.net/go/tcell v0.2.0
) )

2
go.sum
View File

@ -97,6 +97,8 @@ maunium.net/go/mautrix v0.3.2 h1:YLTj8euBTxb118XOryghWpsE/aieFI4lG6jCpCmw5HA=
maunium.net/go/mautrix v0.3.2/go.mod h1:SkGZzch8CvU2qKtNpYxtzZ0sQxfVEJ3IsVVLSUBUx9Y= maunium.net/go/mautrix v0.3.2/go.mod h1:SkGZzch8CvU2qKtNpYxtzZ0sQxfVEJ3IsVVLSUBUx9Y=
maunium.net/go/mautrix v0.3.3 h1:PV+5oSDaFj3cPTE062O44q/G83x7qfP6gm9kr+BZIgE= maunium.net/go/mautrix v0.3.3 h1:PV+5oSDaFj3cPTE062O44q/G83x7qfP6gm9kr+BZIgE=
maunium.net/go/mautrix v0.3.3/go.mod h1:SkGZzch8CvU2qKtNpYxtzZ0sQxfVEJ3IsVVLSUBUx9Y= maunium.net/go/mautrix v0.3.3/go.mod h1:SkGZzch8CvU2qKtNpYxtzZ0sQxfVEJ3IsVVLSUBUx9Y=
maunium.net/go/mautrix v0.3.4 h1:0X8VPXqG2i1nh/P5J0ZRu8ioed6hwK5SBBEQkUuFb68=
maunium.net/go/mautrix v0.3.4/go.mod h1:SkGZzch8CvU2qKtNpYxtzZ0sQxfVEJ3IsVVLSUBUx9Y=
maunium.net/go/mauview v0.1.0 h1:x2WdkKI2zdriJuPAB0CKlwmnHGE7W9xfM5z6RgG+IIg= maunium.net/go/mauview v0.1.0 h1:x2WdkKI2zdriJuPAB0CKlwmnHGE7W9xfM5z6RgG+IIg=
maunium.net/go/mauview v0.1.0/go.mod h1:og9WbzmWe9SNYNyOFlCv8qa9zMcOvG2nzRJ5vYyud9U= maunium.net/go/mauview v0.1.0/go.mod h1:og9WbzmWe9SNYNyOFlCv8qa9zMcOvG2nzRJ5vYyud9U=
maunium.net/go/mauview v0.1.1 h1:wfTXyPx3LGAGpTskh+UbBv/QItUWnEpaneHmywoYnfY= maunium.net/go/mauview v0.1.1 h1:wfTXyPx3LGAGpTskh+UbBv/QItUWnEpaneHmywoYnfY=