This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
generated from AlexsJones/KubeOps
-
Notifications
You must be signed in to change notification settings - Fork 1
104 lines (103 loc) · 3.08 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
---
# This workflow is triggered whenever we release a new version of Starboard
# by creating an annotated Git tag and pushing it to the upstream Git repository.
#
# ./release.sh {patch|minor|major}
name: Release Source
on:
push:
tags:
- "v*"
env:
GO_VERSION: "1.20"
KIND_VERSION: "v0.11.1"
jobs:
tests:
name: Run tests
runs-on: ubuntu-20.04
environment: "GITHUB CI"
timeout-minutes: 15
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Kubernetes cluster (KIND)
uses: helm/kind-action@v1.10.0
with:
version: ${{ env.KIND_VERSION }}
cluster_name: kind-test
- name: Test connection to Kubernetes cluster
run: |
kubectl cluster-info
kubectl wait --for=condition=Ready nodes --all --timeout=300s
kubectl describe node
- name: Run tests
run: |
make all-tests
env:
KUBECONFIG: /home/runner/.kube/config
ARDOQ_BASEURI: ${{ secrets.ARDOQ_BASEURI }}
ARDOQ_ORG: ${{ secrets.ARDOQ_ORG }}
ARDOQ_WORKSPACE_ID: ${{ secrets.ARDOQ_WORKSPACE_ID }}
ARDOQ_APIKEY: ${{ secrets.ARDOQ_APIKEY }}
ARDOQ_CLUSTER: ${{ secrets.ARDOQ_CLUSTER }}
release:
name: Release
needs:
- tests
runs-on: ubuntu-20.04
environment: "GITHUB CI"
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Login to docker.io registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Dockerhub
uses: docker/build-push-action@v5
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64
push: true
tags: ardoq/k8s-ardoq-bridge:latest,ardoq/k8s-ardoq-bridge:${{ steps.vars.outputs.tag }}
- name: Release
uses: goreleaser/goreleaser-action@v5
with:
version: v1.1.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}