-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathbitrise.yml
More file actions
104 lines (91 loc) · 2.8 KB
/
Copy pathbitrise.yml
File metadata and controls
104 lines (91 loc) · 2.8 KB
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
99
100
101
102
103
104
format_version: "11"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: other
app:
envs:
- BIN_NAME: envman
step_bundles:
setup-go:
steps:
- script:
title: Setup pinned Go version
inputs:
- content: asdf install
workflows:
test:
after_run:
- run_integration_tests
title: Runs tests
steps:
- bundle::setup-go: {}
- go-list: { }
- script:
title: golangci-lint
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
INSTALL_DIR=$(go env GOPATH)/bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$INSTALL_DIR" v2.6.0
asdf reshim golang
"$INSTALL_DIR"/golangci-lint run
- go-test: { }
run_integration_tests:
steps:
- script:
title: Run integration tests
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
current_envman="$(pwd)/_tmp/test_envman"
export CGO_ENABLED=0
go build -o "$current_envman"
export PR="" PULL_REQUEST_ID=""
export INTEGRATION_TEST_BINARY_PATH="$current_envman"
# prevent the env var content (with the content of this script)
# being added to the test process environment
unset content
go test -v ./_tests/integration/...
create-release:
description: Creates Linux and Darwin binaries, then publishes a GitHub release
envs:
- GITHUB_TOKEN: $GIT_BOT_USER_ACCESS_TOKEN # Goreleaser expects this env var
steps:
- bundle::setup-go: {}
- script@1:
title: Validate if Envman version matches the git tag
inputs:
- content: |-
#!/bin/bash
set -ex
version=$(go run main.go --version)
if [[ "v$version" != "$BITRISE_GIT_TAG" ]]; then
echo "Envman version ($version) does not match the git tag ($BITRISE_GIT_TAG)"
echo "Please update the Envman version to match the git tag"
exit 1
fi
- script:
title: Goreleaser (create binaries + publish to GH)
deps:
brew:
- name: goreleaser
inputs:
- content: |
#!/usr/bin/env bash
set -ex
goreleaser release
test-binary-build:
description: Tests the release build process by creating a snapshot release (without publishing)
steps:
- bundle::setup-go: {}
- script:
title: Goreleaser (create snapshot binaries)
deps:
brew:
- name: goreleaser
inputs:
- content: |
#!/usr/bin/env bash
set -ex
goreleaser release --snapshot --clean