-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy path.cirrus.yml
98 lines (91 loc) · 3.05 KB
/
.cirrus.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
docker_builder:
name: Test (Linux with Docker)
alias: Tests
test_script:
- wget --no-verbose -O - https://golang.org/dl/go1.15.linux-amd64.tar.gz | tar -C /usr/local -xz
- export PATH=$PATH:/usr/local/go/bin
- go test ./...
env:
HOME: /root
docker_builder:
name: Test (Linux with Podman)
alias: Tests
install_podman_script:
- . /etc/os-release
- echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
- curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
- sudo apt-get update
- sudo apt-get -y upgrade
- sudo apt-get -y install podman
run_podman_background_script:
- podman system service -t 0 unix:///tmp/podman.sock
test_script:
- wget --no-verbose -O - https://golang.org/dl/go1.15.linux-amd64.tar.gz | tar -C /usr/local -xz
- export PATH=$PATH:/usr/local/go/bin
- go test ./...
env:
HOME: /root
CIRRUS_CONTAINER_BACKEND: podman
docker_builder:
name: Test (Windows)
alias: Tests
platform: windows
os_version: 2019
test_script:
- choco install -y golang
- refreshenv
- md C:\Windows\system32\config\systemprofile\AppData\Local\Temp
- go test ./...
task:
name: Release (Dry Run)
only_if: $CIRRUS_TAG == ''
container:
image: goreleaser/goreleaser:latest
release_script: goreleaser build --snapshot
binaries_artifacts:
path: "dist/cirrus_*/cirrus*"
apple_silicon: &APPLE_SILICON_BUILD
osx_instance:
image: catalina-xcode
env:
GOPATH: $HOME/go
PATH: $GOPATH/bin:$PATH
install_script:
- brew update
- brew install go
gotip_script:
- go get golang.org/dl/gotip
- gotip download
- gotip version
build_script:
- CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 gotip build -o cirrus-darwin-arm64 -ldflags "-X github.com/cirruslabs/cirrus-cli/internal/version.Version=$CIRRUS_TAG" cmd/cirrus/main.go
task:
name: Release Apple Silicon (Dry Run)
only_if: $CIRRUS_TAG == ''
<< : *APPLE_SILICON_BUILD
binary_artifacts:
path: cirrus-darwin-arm64
task:
name: Release
only_if: $CIRRUS_TAG != ''
depends_on:
- Lint
- Tests
env:
GITHUB_TOKEN: ENCRYPTED[!98ace8259c6024da912c14d5a3c5c6aac186890a8d4819fad78f3e0c41a4e0cd3a2537dd6e91493952fb056fa434be7c!]
container:
image: goreleaser/goreleaser:latest
release_script: goreleaser
task:
name: Release Apple Silicon
only_if: $CIRRUS_RELEASE != ''
depends_on: Release
env:
GITHUB_TOKEN: ENCRYPTED[!98ace8259c6024da912c14d5a3c5c6aac186890a8d4819fad78f3e0c41a4e0cd3a2537dd6e91493952fb056fa434be7c!]
<<: *APPLE_SILICON_BUILD
upload_script: |
curl -X POST \
--data-binary @cirrus-darwin-arm64 \
--header "Authorization: token $GITHUB_TOKEN" \
--header "Content-Type: application/octet-stream" \
https://uploads.github.com/repos/$CIRRUS_REPO_FULL_NAME/releases/$CIRRUS_RELEASE/assets?name=cirrus-darwin-arm64