Commit 0adba982 authored by Simon Kirsten's avatar Simon Kirsten
Browse files

Improved CI pipeline and added version information

parent 416e72a1
Pipeline #22298 passed with stages
in 1 minute and 29 seconds
# This is the CI file for GitLab Pages
pages:
stage: deploy
image: python:3.7-alpine
before_script:
# TODO: we should consider also version locking these packages:
# + everything will work in the future
# - we wont see any future improvements by mkdocs or mkdocs-material
- pip install mkdocs
- pip install mkdocs-material
script:
- mkdocs build
- mv site public
- mv binaries public/
- mv site public # move mkdocs output to public
- mv binaries public/ # move binaries from the build stage to public
artifacts:
paths:
- public
# This is the CI file for the stream-tv-server
server:
stage: build
image: golang:1.12
variables:
LDFLAGS: -s -X code.fbi.h-da.de/simons-nzse-2/stream-tv/pkg/twitch.ClientID=${TWITCH_CLIENT_ID}
# TWITCH_CLIENT_ID is supplied via the GitLab CI/CD environment variables. This way only project owners can see the private key.
before_script:
- VERSION=$(git describe --always --long --dirty)
- export LDFLAGS="-s -X stream-tv/pkg/twitch.ClientID=$TWITCH_CLIENT_ID -X stream-tv/cmd/stream-tv-server/main.version=$VERSION"
- go mod download
- echo "building $VERSION"
script:
- env GOOS=darwin GOARCH=386 go build -ldflags "${LDFLAGS}" -o binaries/darwin-x86/stream-tv-server ./cmd/stream-tv-server
- env GOOS=darwin GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o binaries/darwin-x86_64/stream-tv-server ./cmd/stream-tv-server
- env GOOS=darwin GOARCH=386 go build -ldflags "$LDFLAGS" -o binaries/darwin-x86/stream-tv-server ./cmd/stream-tv-server
- env GOOS=darwin GOARCH=amd64 go build -ldflags "$LDFLAGS" -o binaries/darwin-x86_64/stream-tv-server ./cmd/stream-tv-server
- env GOOS=linux GOARCH=386 go build -ldflags "${LDFLAGS}" -o binaries/linux-x86/stream-tv-server ./cmd/stream-tv-server
- env GOOS=linux GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o binaries/linux-x86_64/stream-tv-server ./cmd/stream-tv-server
- env GOOS=linux GOARCH=arm go build -ldflags "${LDFLAGS}" -o binaries/linux-arm/stream-tv-server ./cmd/stream-tv-server
- env GOOS=linux GOARCH=arm64 go build -ldflags "${LDFLAGS}" -o binaries/linux-arm64/stream-tv-server ./cmd/stream-tv-server
- env GOOS=linux GOARCH=386 go build -ldflags "$LDFLAGS" -o binaries/linux-x86/stream-tv-server ./cmd/stream-tv-server
- env GOOS=linux GOARCH=amd64 go build -ldflags "$LDFLAGS" -o binaries/linux-x86_64/stream-tv-server ./cmd/stream-tv-server
- env GOOS=linux GOARCH=arm go build -ldflags "$LDFLAGS" -o binaries/linux-arm/stream-tv-server ./cmd/stream-tv-server
- env GOOS=linux GOARCH=arm64 go build -ldflags "$LDFLAGS" -o binaries/linux-arm64/stream-tv-server ./cmd/stream-tv-server
- env GOOS=windows GOARCH=386 go build -ldflags "${LDFLAGS}" -o binaries/windows-x86/stream-tv-server.exe ./cmd/stream-tv-server
- env GOOS=windows GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o binaries/windows-x86_64/stream-tv-server.exe ./cmd/stream-tv-server
- env GOOS=windows GOARCH=386 go build -ldflags "$LDFLAGS" -o binaries/windows-x86/stream-tv-server.exe ./cmd/stream-tv-server
- env GOOS=windows GOARCH=amd64 go build -ldflags "$LDFLAGS" -o binaries/windows-x86_64/stream-tv-server.exe ./cmd/stream-tv-server
artifacts:
paths:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment