-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
49 lines (48 loc) · 2.98 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
os:
- osx
- windows
language: go
go:
- 1.13.x
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install p7zip; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install 7zip; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export "PATH=/c/Program Files/7-Zip:/c/Users/travis/gopath/bin:$PATH"; fi
env: GO111MODULE=on CGO_ENABLED=0
install:
- go mod download
script:
# building MacOS binary
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then go build -o go-backup-mac-x64 && chmod a+x go-backup-mac-x64; fi
# building Linux binary
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export GOOS=linux; export GOARCH=amd64; go build -o go-backup-linux-x64 && chmod a+x go-backup-linux-x64; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export GOOS=linux; export GOARCH=386; go build -o go-backup-linux-x86 && chmod a+x go-backup-linux-x86; fi
# building Windows binary
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export GOOS=windows; export GOARCH=amd64; go build -o go-backup-windows-x64.exe; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export export GOOS=windows; export GOARCH=386; go build -o go-backup-windows-x86.exe; fi
before_deploy:
- export RELEASE_TITLE=$(date '+%Y%m%d%H%M%S')-$TRAVIS_JOB_NUMBER
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 7z a -tzip go-backup-$TRAVIS_TAG-linux-x86.zip go-backup-linux-x86; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 7z a -tzip go-backup-$TRAVIS_TAG-linux-x64.zip go-backup-linux-x64; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 7z a -tzip go-backup-$TRAVIS_TAG-mac-x64.zip go-backup-mac-x64; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then 7z.exe a -tzip go-backup-$TRAVIS_TAG-win-x86.zip go-backup-windows-x86.exe; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then 7z.exe a -tzip go-backup-$TRAVIS_TAG-win-x64.zip go-backup-windows-x64.exe; fi
deploy:
provider: releases
name: Release $TRAVIS_TAG ($RELEASE_TITLE)
file_glob: true
skip_cleanup: true
api_key:
secure: IyPo2QjXo8QL081gR9eCJpNrwdWcSPyr88Yz5AEPFI59PK+QFnmSHFEqTAkhKDaX3ivEjgfhW+LKnqVw1y9+ulbo3oUa7kGwgHPlcCpKhvgVvK35zhW4ZK9EW1lvjdbTr2KcexA5vSSXe+Jl7+rv34a4UusDwn5TnB65wGXEIOK0q7FuDzLGR9tXmExcVD/vYtbGj/fOomUvM5ayF9aDF+cD/47ddnUcVA78IUAoSPKwQZc8/3czJVFEKCBEjGM1CpK0M8m1lphdxQg1q1lzI1kANbtggt8e5gnyWbsPsVOLzTIixJkdf4o8Sl5RZbEJM4ygM4BWXx3VsJCA2+U7gvdWrgY5xPYRnrSW6yMhP5mJjKIJWlTwdhpzJKPIzIwbh89aI4Q2pHbKDgL01UOdx7P/OZTTLil+4bGYzCzlrPF9meik/mb+XWZnk4Dbq4rLEus1OtImMfUGpZR54yAzXdMK2/uXsZ9DtAijWeLmdq8BXNiqwZT4S+9Qv7gJPEwaAAAUq2oro9ga3d9x83e0SPhWl4W4mtohF+WQ2j6kEwiysOMmzvfCK4sl5yKzQIqX1QU8CMChrJpXOUzmSRLeNB9SVbWQA4mPfPuI2mqr8m6HRtX9fo/sMuUBaN2Mhd+zMvPu1xAJhPS4L5q61cGI3gmq+RF/hXkzbkhSMY1lAv8=
file:
- go-backup-$TRAVIS_TAG-win-x86.zip
- go-backup-$TRAVIS_TAG-win-x64.zip
- go-backup-$TRAVIS_TAG-linux-x86.zip
- go-backup-$TRAVIS_TAG-linux-x64.zip
- go-backup-$TRAVIS_TAG-mac-x64.zip
draft: true
on:
repo: NightMan-1/go-backup
tags: true
all_branches: true