2020-05-10 19:49:35 +02:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- package
|
|
|
|
|
2020-05-10 18:58:27 +02:00
|
|
|
default:
|
2020-05-05 19:39:14 +02:00
|
|
|
before_script:
|
|
|
|
- mkdir -p .cache
|
|
|
|
- export GOPATH="$CI_PROJECT_DIR/.cache"
|
2020-05-10 18:58:27 +02:00
|
|
|
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cache
|
|
|
|
|
2020-05-10 18:59:35 +02:00
|
|
|
.build-linux: &build-linux
|
2020-05-10 18:58:27 +02:00
|
|
|
stage: build
|
2022-04-17 20:21:10 +02:00
|
|
|
before_script:
|
|
|
|
- export GO_LDFLAGS="-s -w -linkmode external -extldflags -static -X main.Tag=$CI_COMMIT_TAG -X main.Commit=$CI_COMMIT_SHA -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'"
|
2020-05-05 19:39:14 +02:00
|
|
|
script:
|
2022-06-01 19:45:06 +02:00
|
|
|
- go build -ldflags "$GO_LDFLAGS" -o gomuks
|
2019-07-25 22:53:45 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-05-08 16:29:29 +02:00
|
|
|
- gomuks
|
2020-05-10 18:58:27 +02:00
|
|
|
|
2020-05-10 19:04:41 +02:00
|
|
|
linux/amd64:
|
2020-05-10 18:58:27 +02:00
|
|
|
<<: *build-linux
|
|
|
|
image: dock.mau.dev/tulir/gomuks-build-docker:linux-amd64
|
|
|
|
|
2020-05-10 19:04:41 +02:00
|
|
|
linux/arm:
|
2020-05-10 18:58:27 +02:00
|
|
|
<<: *build-linux
|
|
|
|
image: dock.mau.dev/tulir/gomuks-build-docker:linux-arm
|
|
|
|
|
2020-05-10 19:04:41 +02:00
|
|
|
linux/arm64:
|
2020-05-10 18:58:27 +02:00
|
|
|
<<: *build-linux
|
|
|
|
image: dock.mau.dev/tulir/gomuks-build-docker:linux-arm64
|
|
|
|
|
2020-05-10 19:04:41 +02:00
|
|
|
windows/amd64:
|
2020-05-10 18:58:27 +02:00
|
|
|
image: dock.mau.dev/tulir/gomuks-build-docker:windows-amd64
|
|
|
|
stage: build
|
|
|
|
script:
|
2022-04-17 20:21:10 +02:00
|
|
|
- go build -o gomuks.exe
|
2020-05-10 18:58:27 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- gomuks.exe
|
2020-05-10 19:49:35 +02:00
|
|
|
|
2021-02-08 21:49:13 +01:00
|
|
|
macos/amd64:
|
2021-02-08 21:52:20 +01:00
|
|
|
stage: build
|
2021-02-08 21:49:13 +01:00
|
|
|
tags:
|
|
|
|
- macos
|
|
|
|
- amd64
|
2022-04-17 20:21:10 +02:00
|
|
|
before_script:
|
|
|
|
- export GO_LDFLAGS="-X main.Tag=$CI_COMMIT_TAG -X main.Commit=$CI_COMMIT_SHA -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'"
|
2021-02-08 21:49:13 +01:00
|
|
|
script:
|
2021-02-09 14:38:25 +01:00
|
|
|
- mkdir gomuks-macos-amd64
|
2022-06-01 19:45:06 +02:00
|
|
|
- go build -ldflags "$GO_LDFLAGS" -o gomuks-macos-amd64/gomuks
|
2021-02-09 14:38:25 +01:00
|
|
|
- install_name_tool -change /usr/local/opt/libolm/lib/libolm.3.dylib @rpath/libolm.3.dylib gomuks-macos-amd64/gomuks
|
|
|
|
- install_name_tool -add_rpath @executable_path gomuks-macos-amd64/gomuks
|
|
|
|
- install_name_tool -add_rpath /usr/local/opt/libolm/lib gomuks-macos-amd64/gomuks
|
|
|
|
- cp /usr/local/opt/libolm/lib/libolm.3.dylib gomuks-macos-amd64/
|
2021-02-08 21:49:13 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-02-09 14:38:25 +01:00
|
|
|
- gomuks-macos-amd64
|
2021-02-08 21:49:13 +01:00
|
|
|
|
|
|
|
macos/arm64:
|
2021-02-08 21:52:20 +01:00
|
|
|
stage: build
|
2021-02-08 21:49:13 +01:00
|
|
|
tags:
|
|
|
|
- macos
|
|
|
|
- arm64
|
|
|
|
before_script:
|
|
|
|
- export LIBRARY_PATH=/opt/homebrew/lib
|
|
|
|
- export CPATH=/opt/homebrew/include
|
|
|
|
- export PATH=/opt/homebrew/bin:$PATH
|
2022-04-17 20:21:10 +02:00
|
|
|
- export GO_LDFLAGS="-X main.Tag=$CI_COMMIT_TAG -X main.Commit=$CI_COMMIT_SHA -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'"
|
2021-02-08 21:49:13 +01:00
|
|
|
script:
|
2021-02-09 14:38:25 +01:00
|
|
|
- mkdir gomuks-macos-arm64
|
2022-06-01 19:45:06 +02:00
|
|
|
- go build -ldflags "$GO_LDFLAGS" -o gomuks-macos-arm64/gomuks
|
2021-02-09 14:38:25 +01:00
|
|
|
- install_name_tool -change /opt/homebrew/opt/libolm/lib/libolm.3.dylib @rpath/libolm.3.dylib gomuks-macos-arm64/gomuks
|
|
|
|
- install_name_tool -add_rpath @executable_path gomuks-macos-arm64/gomuks
|
|
|
|
- install_name_tool -add_rpath /opt/homebrew/opt/libolm/lib gomuks-macos-arm64/gomuks
|
|
|
|
- install_name_tool -add_rpath /usr/local/opt/libolm/lib gomuks-macos-arm64/gomuks
|
|
|
|
- cp /opt/homebrew/opt/libolm/lib/libolm.3.dylib gomuks-macos-arm64/
|
2021-02-08 21:49:13 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-02-09 14:38:25 +01:00
|
|
|
- gomuks-macos-arm64
|
|
|
|
|
|
|
|
macos/universal:
|
|
|
|
stage: package
|
2021-02-18 17:40:06 +01:00
|
|
|
tags:
|
|
|
|
- macos
|
2021-02-09 14:38:25 +01:00
|
|
|
dependencies:
|
|
|
|
- macos/amd64
|
|
|
|
- macos/arm64
|
|
|
|
needs:
|
|
|
|
- macos/amd64
|
|
|
|
- macos/arm64
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
script:
|
|
|
|
- lipo -create -output libolm.3.dylib gomuks-macos-arm64/libolm.3.dylib gomuks-macos-amd64/libolm.3.dylib
|
|
|
|
- lipo -create -output gomuks gomuks-macos-arm64/gomuks gomuks-macos-amd64/gomuks
|
|
|
|
artifacts:
|
|
|
|
name: gomuks-macos-universal
|
|
|
|
paths:
|
2021-02-08 21:49:13 +01:00
|
|
|
- libolm.3.dylib
|
2021-02-09 14:38:25 +01:00
|
|
|
- gomuks
|
2021-02-08 21:49:13 +01:00
|
|
|
|
2020-05-10 19:57:49 +02:00
|
|
|
debian:
|
2020-05-10 19:49:35 +02:00
|
|
|
image: debian
|
|
|
|
stage: package
|
|
|
|
dependencies:
|
|
|
|
- linux/amd64
|
2020-05-10 20:02:12 +02:00
|
|
|
only:
|
|
|
|
- tags
|
2020-05-10 19:49:35 +02:00
|
|
|
script:
|
|
|
|
- mkdir -p deb/usr/bin
|
|
|
|
- cp gomuks deb/usr/bin/gomuks
|
2020-05-10 19:57:49 +02:00
|
|
|
- chmod -R -s deb/DEBIAN && chmod -R 0755 deb/DEBIAN
|
2020-05-10 20:02:12 +02:00
|
|
|
- dpkg-deb --build deb gomuks.deb
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- gomuks.deb
|