зеркало из https://github.com/getsops/sops.git
46 строки
1.3 KiB
YAML
46 строки
1.3 KiB
YAML
language: go
|
|
go: 1.9
|
|
go_import_path: go.mozilla.org/sops/
|
|
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- rpm
|
|
- ruby
|
|
- python3
|
|
|
|
before_install:
|
|
- gem install fpm || sudo gem install fpm
|
|
- curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
- source ~/.cargo/env
|
|
|
|
script:
|
|
- 'if [ "$TRAVIS_REPO_SLUG" != "mozilla/sops" ]; then make; fi'
|
|
- 'if [ "$TRAVIS_REPO_SLUG" = "mozilla/sops" ]; then make origin-build; fi'
|
|
- bash <(curl -s https://codecov.io/bash)
|
|
|
|
before_deploy:
|
|
- mkdir dist
|
|
- make deb-pkg rpm-pkg
|
|
- mv *.deb *.rpm dist/
|
|
- GOOS=darwin CGO_ENABLED=0 go build -o dist/sops-${TRAVIS_TAG}.darwin go.mozilla.org/sops/cmd/sops
|
|
- GOOS=windows CGO_ENABLED=0 go build -o dist/sops-${TRAVIS_TAG}.exe go.mozilla.org/sops/cmd/sops
|
|
- GOOS=linux CGO_ENABLED=0 go build -o dist/sops-${TRAVIS_TAG}.linux go.mozilla.org/sops/cmd/sops
|
|
- |
|
|
if [ ! -z "$TRAVIS_TAG" ]; then
|
|
version="$(grep '^const Version' version/version.go |cut -d '"' -f 2)"
|
|
if [ "$version" != "$TRAVIS_TAG" ]; then
|
|
echo "Git tag $TRAVIS_TAG does not match version $version, update the source!"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
deploy:
|
|
provider: releases
|
|
api_key: "${GITHUB_OAUTH_TOKEN}"
|
|
file_glob: true
|
|
file: dist/*
|
|
skip_cleanup: true
|
|
on:
|
|
tags: true
|