-
Notifications
You must be signed in to change notification settings - Fork 29
96 lines (83 loc) · 3.19 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
name: Function-Mesh Release
on:
release:
types: [created]
jobs:
upload:
if: startsWith(github.ref, 'refs/tags/v')
name: Upload Release files
runs-on: ubuntu-latest
steps:
- name: clean disk
run: |
sudo swapoff -a
sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt clean
docker rmi $(docker images -q) -f
df -h
- name: checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up GO 1.20.4
uses: actions/setup-go@v1
with:
go-version: 1.20.4
id: go
- name: InstallKubebuilder
run: |
curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_linux_amd64.tar.gz | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.1_linux_amd64 /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin
- name: Install operator-sdk
run: |
RELEASE_VERSION=v1.14.0
curl -LO "https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk_linux_amd64"
chmod +x operator-sdk_linux_amd64 && sudo mkdir -p /usr/local/bin/ && sudo mv operator-sdk_linux_amd64 /usr/local/bin/operator-sdk
- name: Set up yq
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.30.4/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
yq --help
- name: Get vertical-pod-autoscaler crd
run: |
wget https://raw.githubusercontent.com/kubernetes/autoscaler/master/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml -O config/crd/bases/vpa-v1-crd.yaml
- name: build release
id: build_release
env:
VERSION: ${{ github.event.release.tag_name }}
IMAGE_TAG_BASE: streamnative/function-mesh
CATALOG_BRANCH_TAG: latest
run: |
# convert vx.y.z to x.y.z because a valid semver is needed in creating the bundle
VERSION=$(echo $VERSION|cut -c 2-)
make release
make docker-push
make docker-build image-push bundle bundle-build bundle-push catalog-build catalog-push
- name: Upload crd.yaml to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: manifests/crd.yaml
asset_name: crd.yaml
tag: ${{ github.ref }}
overwrite: true
- name: Upload rbac.yaml to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: manifests/rbac.yaml
asset_name: rbac.yaml
tag: ${{ github.ref }}
overwrite: true
- name: Upload install.sh to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: install.sh
asset_name: install.sh
tag: ${{ github.ref }}
overwrite: true