forked from bloomberg/spire-tpm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (82 loc) · 2.18 KB
/
main.yaml
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
name: Main
on:
push:
branches:
- '**'
tags:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
- name: Print Go Version
run: go version
- name: Build
run: |
./ci/build.sh
- name: Test plugin
run: |
./ci/test.sh plugin
- name: Test tools
run: |
./ci/test.sh tools
- name: Compute Tag
if: |
github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
id: compute_tag
run: |
tag=${GITHUB_REF#refs/tags/}
if [ "$tag" != "$GITHUB_REF" ]; then
tag=$(echo "$tag" | sed -e 's/[^a-zA-Z0-9\-\.]/-/g')
echo ::set-output name=TAG::${tag}
else
echo "unable to determine tag" >&2
exit 1
fi
- name: Release
if: |
github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./ci/release.sh "${{ steps.compute_tag.outputs.TAG }}"
assets=()
for asset in $(ls releases); do
assets+=("-a" "releases/$asset")
gh release upload "${{ steps.compute_tag.outputs.TAG }}" release/$asset
done
- name: Set up Buildx
if: |
github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
uses: docker/setup-buildx-action@v1
id: buildx
with:
version: v0.5.1
driver: docker-container
install: true
buildkitd-flags: --debug
- name: Login to Docker HUB
if: |
github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker Release
if: |
github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
run: |
./ci/docker.sh "${{ steps.compute_tag.outputs.TAG }}"