-
Notifications
You must be signed in to change notification settings - Fork 5
134 lines (108 loc) · 3 KB
/
ci.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
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
name: CI
on:
push:
branches:
- main
- "v*.*.x"
tags:
- "v*.*.*"
jobs:
setup:
name: Setup
runs-on: ubuntu-22.04
outputs:
components: ${{ steps.set-matrix.outputs.components }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- id: set-matrix
name: Output component builds
run: |
echo "components=$(ls ./components/ | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
publish-docs:
name: Publish docs
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/main'
permissions:
contents: write
pages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: "3.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: pipenv
- name: Cache tools
uses: actions/cache@v3
with:
path: ./tools
key: doc-tools
- name: Generate docs
run: pip install pipenv && make docs
- name: Upload docs
uses: actions/upload-pages-artifact@v1
with:
path: site/
- name: Publish docs
uses: actions/deploy-pages@v2
publish-component:
name: Publish component
runs-on: ubuntu-22.04
needs: setup
strategy:
matrix:
component: ${{ fromJSON(needs.setup.outputs.components) }}
permissions:
contents: read
packages: write
env:
CONTAINER_REGISTRY: ghcr.io/${{ github.repository_owner }}
REGISTRY_USERNAME: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: "3.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Cache tools
uses: actions/cache@v3
with:
path: ./tools
key: build-tools
- name: Build and push component
run: make image COMPONENT=${{ matrix.component }} SKIP_GENERATE=true COMPRESS=true PUSH=true
release:
name: Release
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
needs: publish-component
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create release
uses: softprops/action-gh-release@v1