-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (73 loc) · 2.68 KB
/
release.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
# name: Release
# on:
# workflow_call:
# secrets:
# TEST_ENV:
# required: true
# KONFIG_API_KEY:
# required: true
# SUBMODULE_DEPLOY_KEY_TYPESCRIPT:
# required: false
# SUBMODULE_DEPLOY_KEY_PYTHON:
# required: false
# jobs:
# find-konfig-yamls:
# runs-on: ubuntu-latest
# outputs:
# konfig_yaml_dirs: ${{ steps.find-konfig-yamls.outputs.konfig_yaml_dirs }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Find konfig.yaml files
# id: find-konfig-yamls
# uses: konfig-dev/automation/.github/actions/find-konfig-yamls@main
# check-if-oas-modified:
# runs-on: ubuntu-latest
# needs: find-konfig-yamls
# strategy:
# matrix:
# konfig_yaml_dir: ${{ fromJson(needs.find-konfig-yamls.outputs.konfig_yaml_dirs) }}
# outputs:
# directory: ${{ steps.output.outputs.directory }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ref: ${{ github.head_ref }}
# - name: Read specPath from konfig.yaml
# id: spec-path
# uses: mikefarah/[email protected]
# with:
# cmd: yq '.specPath' ${{ matrix.konfig_yaml_dir }}/konfig.yaml
# - name: Read specInputPath from konfig.yaml
# id: spec-input-path
# uses: mikefarah/[email protected]
# with:
# cmd: yq '.specInputPath' ${{ matrix.konfig_yaml_dir }}/konfig.yaml
# # Use specInputPath if it exists. Otherwise, use specPath
# - name: Determine final OAS input path
# id: final-oas-path
# run: |
# if [ ${{ steps.spec-input-path.outputs.result }} = "null" ]; then
# oas=${{ steps.spec-path.outputs.result }}
# else
# oas=${{ steps.spec-input-path.outputs.result }}
# fi
# echo "oas=${{ matrix.konfig_yaml_dir }}/$oas" >> $GITHUB_OUTPUT
# - name: Check if OAS was modified
# id: check-oas-modified
# uses: tj-actions/[email protected]
# with:
# files: ${{ steps.final-oas-path.outputs.oas }}
# # If OAS was modified, set job output to this konfig.yaml's directory
# - name: Set output if OAS was modified
# id: output
# if : steps.check-oas-modified.outputs.any_changed == 'true'
# run: echo "directory=${{ matrix.konfig_yaml_dir }}" >> $GITHUB_OUTPUT
# regenerate-sdks:
# needs: check-if-oas-modified
# if: needs.check-if-oas-modified.outputs.directory != ''
# uses: ./.github/workflows/regenerate-sdks.yaml
# with:
# konfig_yaml_dir: ${{ needs.check-if-oas-modified.outputs.directory }}
# secrets: inherit