Skip to content

MeshModel Component Generator and Updater #70

MeshModel Component Generator and Updater

MeshModel Component Generator and Updater #70

name: MeshModel Component Generator and Updater
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
generate-components:
name: Generate Components
if: github.repository == 'Jougan-0/meshery'
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@master
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@master
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: 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 17pCf_DJsmFCLPCbzh8Rm__59fX8s-fTH7mNpIb1p08Y
- name: Send Email on Meshmodel Generators Failure
if: failure()
uses: dawidd6/action-send-mail@v3.7.1
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" <no-reply@meshery.io>
to: developers@meshery.io
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: Run component Updation
env:
CRED: ${{ secrets.INTEGRATION_SPREADSHEET_CRED }}
run: |
cd scripts/component_updater
go build main.go
./main https://docs.google.com/spreadsheets/d/e/2PACX-1vRWZ2h37Ojyk1TDHntXEsj1HQkj-xjKgzAv1uaj9G6xy1DIgoNkSS52ewVQ9T1AzG5LENB2fLWAJ19H/pub?gid=1294815280/pub\?gid\=0\&single\=true\&output\=csv --system meshery ../../server/meshmodel
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_user_name: l5io
commit_user_email: ci@layer5.io
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/action-send-mail@v3.7.1
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" <no-reply@meshery.io>
to: developers@meshery.io
body: |
The GitHub Actions workflow in ${{ github.repository }} has failed.
You can find more details in the GitHub Actions log ${{ github.workflow }}.