-
Notifications
You must be signed in to change notification settings - Fork 8
73 lines (60 loc) · 1.93 KB
/
cd.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
name: cd
on:
push:
tags:
- '*'
jobs:
release:
name: Release
strategy:
matrix:
go-version: [1.19.2]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Build all
run: make all
- name: Extract tag version from ref
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Publish docker image locally for Snyk action
run: make docker-build
- name: Run Snyk to monitor vulnerabilities in Docker image
uses: snyk/actions/docker@master
if: ${{ !contains(github.ref, 'rc') }}
with:
image: "snowplow/dataflow-runner:${{ github.ref_name }}"
args: "--app-vulns --org=data-processing-new"
command: monitor
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Create GitHub release and attach artifacts
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: ${{ contains(github.ref , '-') }}
name: Version ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
files: |
build/bin/dataflow_runner_${{ github.ref_name }}_darwin_amd64.zip
build/bin/dataflow_runner_${{ github.ref_name }}_linux_amd64.zip
build/bin/dataflow_runner_${{ github.ref_name }}_windows_amd64.zip
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish docker image
run: make docker-cross-build-publish