-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (50 loc) · 1.69 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
name: Build Changelog and Github Release
on:
push:
tags:
- v*
jobs:
releaser:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: setup go
uses: actions/setup-go@v4
with:
go-version: '1.20.x'
cache: true
- name: Build binary
run: |
make build
- name: Build docker image
run: |
make image VERSION=${{ github.ref_name }}
- name: Scan The Image
run: |
REPO=policy-agent
VERSION=${{ github.ref_name }}
echo scanning ${REPO}:${VERSION}
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b /usr/local/bin
grype "${REPO}:${VERSION}" --scope all-layers > /tmp/report.txt #--fail-on high to fail on sev high
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Release and push to Docker Registry
run: |
make push@weaveworks tag-file=new-tag version-file=new-version VERSION=${{ github.ref_name }}
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v2
with:
configuration: "${{ github.workspace }}/.github/workflows/changelog_configuration.json"
env:
GITHUB_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
body: ${{steps.github_release.outputs.changelog}}