-
Notifications
You must be signed in to change notification settings - Fork 23
136 lines (119 loc) · 4.4 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Copyright (c) 2020, 2024, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
# ---------------------------------------------------------------------------
# Coherence Operator GitHub Actions Release build.
# ---------------------------------------------------------------------------
name: Operator Release
on:
release:
types: [prereleased, released]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: oracle-actions/setup-java@v1
with:
website: oracle.com
release: 21
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Cache Go Modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mods-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mods-
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache Tools
uses: actions/cache@v4
with:
path: build/tools
key: ${{ runner.os }}-build-tools-${{ hashFiles('**/Makefile') }}
restore-keys: ${{ runner.os }}-build-tools
- name: Start KinD Cluster
shell: bash
run: |
make kind
kubectl version
kubectl get nodes
docker pull gcr.io/distroless/java
docker pull gcr.io/distroless/java11-debian11
docker pull gcr.io/distroless/java17-debian11
make get-tanzu
- name: Release
shell: bash
run: |
docker login ghcr.io/oracle/ --username ${{ secrets.IMAGE_REGISTRY_USER }} --password ${{ secrets.IMAGE_REGISTRY_TOKEN }}
git config --local user.name "Github Action"
git config --local user.email "[email protected]"
export NO_DAEMON=false
make clean
make all
make trivy-scan
if echo $GITHUB_EVENT_NAME -eq "release"; then PRE_RELEASE=false; else PRE_RELEASE=true; fi
make release RELEASE_DRY_RUN=false PRE_RELEASE=$PRE_RELEASE
- name: Upload Release Manifests
id: upload-release-manifests
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /tmp/coherence-operator/_output/coherence-operator-manifests.tar.gz
asset_name: coherence-operator-manifests.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Release Yaml
id: upload-release-yaml
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /tmp/coherence-operator/_output/coherence-operator.yaml
asset_name: coherence-operator.yaml
asset_content_type: text/plain
- name: Upload Release CRD
id: upload-release-crd
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /tmp/coherence-operator/_output/manifests/crd/coherence.oracle.com_coherence.yaml
asset_name: coherence.oracle.com_coherence.yaml
asset_content_type: text/plain
- name: Upload Release Small CRD
id: upload-release-small-crd
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /tmp/coherence-operator/_output/manifests/crd-small/coherence.oracle.com_coherence.yaml
asset_name: coherence.oracle.com_coherence_small.yaml
asset_content_type: text/plain
- name: Upload Release Dashboards
id: upload-release-dashboards
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /tmp/coherence-operator/_output/coherence-dashboards.tar.gz
asset_name: coherence-dashboards.tar.gz
asset_content_type: text/plain