-
Notifications
You must be signed in to change notification settings - Fork 50
58 lines (50 loc) · 1.52 KB
/
automation-regenerate-go-sdk.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
---
name: Regenerate the Go SDK
on:
push:
branches:
- main
paths:
- 'api-definitions/**'
- 'tools/generator-go-sdk/**'
workflow_dispatch: # for manual invocations
concurrency:
group: 'regengosdk-${{ github.head_ref }}'
cancel-in-progress: true
jobs:
regenerate-go-sdk:
runs-on: custom-linux-large
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.21.3'
- name: "Launch SSH Agent"
run: |
# launch an ssh agent and export it's env vars
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
env:
SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock
- name: "Load SSH Key"
run: |
# load the Deployment Write Key for the Go SDK repository
echo "${{ secrets.GOSDK_DEPLOYMENT_WRITE_KEY }}" | ssh-add -
env:
SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock
- name: "Run the Go SDK Generator"
run: |
# go go gadget generator
./scripts/automation-generate-and-commit-go-sdk.sh
env:
SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock
- name: "Remove the Key from the SSH Agent"
if: always()
run: |
# remove the ssh key
ssh-add -D
env:
SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock
- name: "Terminate the SSH Agent"
if: always()
run: |
pkill -9 ssh-agent