forked from meshery/meshery
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (105 loc) · 4.02 KB
/
meshmodel-generators.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
name: MeshModel Component Generator and Updater
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
generate-components:
name: Generate Components
if: github.repository == 'meshery/meshery'
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
# - name: Setup Cache
# uses: actions/cache@v3
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-
- name: Pull changes from remote
run: git pull origin master
- name: Run component generation
env:
CRED: ${{ secrets.INTEGRATION_SPREADSHEET_CRED }}
run: |
cd scripts/component_generation; GOPROXY=https://proxy.golang.org,direct GOSUMDB=off go run main.go 1DZHnzxYWOlJ69Oguz4LkRVTFM79kC2tuvdwizOJmeMw
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: "--signoff"
commit_message: "New Meshmodel components generated"
branch: master
- name: Send Email on Meshmodel Generators Failure
if: failure()
uses: dawidd6/[email protected]
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: GitHub Actions - Workflow Failure
from: |
"Meshmodel Generator" <[email protected]>
body: |
The GitHub Actions workflow in ${{ github.repository }} has failed.
You can find more details in the GitHub Actions log ${{ github.workflow }}.
update-components:
name: Update Components
needs: generate-components
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.21"
- name: Pull changes from remote
run: git pull origin master
- name: Run component Updater
env:
CRED: ${{ secrets.INTEGRATION_SPREADSHEET_CRED }}
run: |
cd scripts/component_updater
go build main.go
./main https://docs.google.com/spreadsheets/d/e/2PACX-1vSgOXuiqbhUgtC9oNbJlz9PYpOEaFVoGNUFMIk4NZciFfQv1ewZg8ahdrWHKI79GkKK9TbmnZx8CqIe/pub\?gid\=0\&single\=true\&output\=csv --system meshery ../../server/meshmodel
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: "--signoff"
commit_message: "Meshmodel components updated"
branch: master
- name: Send Email on Meshmodel Updaters Failure
if: failure()
uses: dawidd6/[email protected]
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: GitHub Actions - Workflow Failure
from: |
"Meshmodel Updater" <[email protected]>
body: |
The GitHub Actions workflow in ${{ github.repository }} has failed.
You can find more details in the GitHub Actions log ${{ github.workflow }}.