-
Notifications
You must be signed in to change notification settings - Fork 20
82 lines (68 loc) · 2.22 KB
/
release.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
name: release
on:
push:
tags: ['v0*']
# We need to do an API code review before we allow v1.
# Our command and package are not yet stable.
permissions:
contents: write
jobs:
release_kiln:
name: "Release Kiln"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEEN_GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
run: go build ./...
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.RELENG_CI_BOT_KEY }}
- name: Unit Test
env:
RELEEN_GITHUB_TOKEN: ${{ secrets.RELEEN_GITHUB_TOKEN }}
run: |
export GITHUB_TOKEN="${RELEEN_GITHUB_TOKEN}"
go test --covermode=atomic --coverprofile=kiln-${{github.sha}}-unit-test-code-coverage.out ./...
- name: Archive Unit Test Code Coverage Output
uses: actions/upload-artifact@v3
with:
name: Unit Test Code Coverage Output
path: kiln-${{github.sha}}-unit-test-code-coverage.out
- name: Acceptance Tests
env:
CGO_ENABLED: '0'
RELEEN_GITHUB_TOKEN: ${{ secrets.RELEEN_GITHUB_TOKEN }}
run: |
set -euo pipefail
export GITHUB_TOKEN="${RELEEN_GITHUB_TOKEN}"
set -x
go test -v --timeout 24h --tags acceptance github.com/pivotal-cf/kiln/internal/acceptance/workflows
git reset --hard HEAD
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GCR
uses: docker/login-action@v2
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.TAS_PPE_GCR_SERVICE_JSON_KEY }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}