-
Notifications
You must be signed in to change notification settings - Fork 143
89 lines (85 loc) · 2.96 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
84
85
86
87
88
89
name: Release
on:
release:
types:
- created
jobs:
release:
name: Release on GitHub
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
id: go
- name: Dependencies
env:
GO111MODULE: on
run: |
go install golang.org/x/lint/golint@latest
go install github.com/kisielk/errcheck@latest
go install github.com/golangci/golangci-lint/cmd/[email protected]
curl -L -o operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/v1.0.0/operator-sdk-v1.0.0-x86_64-linux-gnu"
chmod +x operator-sdk
sudo mv operator-sdk /bin/
- name: build binary
env:
TAG: ${{ github.event.release.tag_name }}
run: |
go get github.com/VictoriaMetrics/operator/api
make lint
make test
make build
make release-package
# - name: setup KIND for e2e tests
# uses: engineerd/[email protected]
# with:
# version: "v0.9.0"
# image: kindest/node:v1.16.4
# - name: run e2e tests local
# run: |
# kubectl cluster-info
# kubectl get pods -n kube-system
# echo "current-context:" $(kubectl config current-context)
# echo "environment-kubeconfig:" ${KUBECONFIG}
# make e2e-local
- name: build crosscompile and push to remote registry
env:
TAG: "${{ github.event.release.tag_name }}"
run: |
echo ${{secrets.REPO_KEY}} | docker login --username ${{secrets.REPO_USER}} --password-stdin
make publish-via-docker
make publish-via-docker-config-reloader
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./bundle_crd.zip
asset_name: bundle_crd.zip
asset_content_type: application/zip
- name: Upload Release binary
id: upload-release-binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./operator.zip
asset_name: operator.zip
asset_content_type: application/zip
- name: Upload Release CRDs
id: upload-release-crds
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./release/crds/crd.yaml
asset_name: crd.yaml
asset_content_type: application/yaml