-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (55 loc) · 1.68 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
name: release
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.20"
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- uses: actions/cache@v2
with:
path: ./testbin
key: ${{ runner.os }}-testbin
- uses: actions/cache@v2
with:
path: ./bin
key: ${{ runner.os }}-bin
- name: Run tests
run: make test
- name: Build image
run: make docker-build
- name: Export release name
run: |
echo "NEW_RELEASE=$(make get-new-release)" >> $GITHUB_ENV
- name: Login to quay.io/3scale
if: ${{ env.NEW_RELEASE != '' }}
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Push new operator image
if: ${{ env.NEW_RELEASE != '' }}
run: make docker-push
- name: Publish new bundle image in saas-operator catalog
if: ${{ env.NEW_RELEASE != '' }}
run: make bundle-publish
- name: Create a new draft-release in github
if: ${{ env.NEW_RELEASE != '' }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.NEW_RELEASE }}"
title: "${{ env.NEW_RELEASE }}"
draft: true