forked from gatekeeper/gatekeeper-operator
-
Notifications
You must be signed in to change notification settings - Fork 4
83 lines (71 loc) · 2.28 KB
/
release.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
name: Build and release images
on:
push:
branches:
- main
- release-[0-9]+.[0-9]+
tags:
- 'v*' # tags matching v*, i.e. v0.0.1, v1.0.0-rc.0
env:
VERSION_TAG: ${{ github.ref_name }}
jobs:
build:
name: Image build and push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Set Up Go to Install OPM
uses: actions/setup-go@v3
with:
go-version-file: go.mod
# Issue ref: https://github.com/actions/checkout/issues/290.
- name: Extract Non-Annotated Version Tag
run: |
echo "GIT_VERSION=$(git describe --tags --match='v*' --always --dirty)" >> ${GITHUB_ENV}
- name: Verify release manifest
if: ${{ github.ref_type == 'tag' }}
run: |
make release
git diff --exit-code ./deploy/gatekeeper-operator.yaml
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
with:
driver-opts: image=moby/buildkit:v0.8-beta
- uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and Push Images
run: |
echo "::group::gatekeeper-operator"
make docker-build
make docker-push
echo "::endgroup::"
echo "::group::gatekeeper-operator-bundle"
make bundle-build
make bundle-push
echo "::endgroup::"
echo "::group::gatekeeper-operator-bundle-index"
make bundle-index-build
make bundle-index-push
echo "::endgroup::"
- name: Create Release
id: create_release
uses: actions/create-release@v1
if: ${{ github.ref_type == 'tag' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions.
with:
tag_name: ${{ github.ref }}
release_name: Gatekeeper Operator ${{ github.ref }}
body: |
To install the Gatekeeper Operator:
```
kubectl apply -f https://raw.githubusercontent.com/${{ github.repository }}/${{ env.VERSION_TAG }}/deploy/gatekeeper-operator.yaml
```
generateReleaseNotes: true
draft: true
prerelease: false