Skip to content

Commit 3d403cb

Browse files
author
tejasgn
committed
move everything to one workflow
1 parent 8409d54 commit 3d403cb

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed

.github/workflows/sync-S3-KB.yml

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: syncS3andKB
22
on:
33
push:
4-
branches: ["main"]
4+
branches: ["sync-for-steer-specs"]
55
workflow_dispatch:
66
inputs:
77
sdk_name:
@@ -21,6 +21,9 @@ on:
2121
- php
2222
- cpp
2323
- kotlin
24+
- steering_docs
25+
- specs
26+
- coding-standards
2427

2528
permissions:
2629
id-token: write
@@ -53,11 +56,35 @@ jobs:
5356
echo "S3_LANGUAGE=rust" >> $GITHUB_ENV
5457
elif [ "$sdk_name" == "gov2" ]; then
5558
echo "S3_LANGUAGE=go" >> $GITHUB_ENV
59+
elif [ "$sdk_name" == "steering_docs" ]; then
60+
echo "S3_LANGUAGE=steering-docs" >> $GITHUB_ENV
61+
elif [ "$sdk_name" == "coding-standards" ]; then
62+
echo "S3_LANGUAGE=coding-standards" >> $GITHUB_ENV
63+
elif [ "$sdk_name" == "specs" ]; then
64+
echo "S3_LANGUAGE=final-specs" >> $GITHUB_ENV
5665
else
5766
echo "S3_LANGUAGE=$sdk_name" >> $GITHUB_ENV
5867
fi
59-
68+
69+
- name: Filter SPECIFICATION.md files for specs
70+
if: ${{ github.event.inputs.sdk_name == 'specs' }}
71+
run: |
72+
find ./scenarios -name "SPECIFICATION.md" | while read file; do
73+
mkdir -p "./filtered_specs/$(dirname "$file")"
74+
cp "$file" "./filtered_specs/$file"
75+
done
76+
77+
- name: Clone and filter for coding standards
78+
if: ${{ github.event.inputs.sdk_name == 'coding-standards' }}
79+
run: |
80+
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki-repo
81+
mkdir -p ./filtered-wiki
82+
find ./wiki-repo -type f -name "*[Gg]uidelines*.md" -o -name "*[Ss]tandards*.md" | while read file; do
83+
cp "$file" ./filtered-wiki/
84+
done
85+
6086
- name: Extract and copy premium examples in temp. dir.
87+
if: ${{ contains(fromJSON('["javascriptv3","dotnetv4","javav2","rustv1","gov2","swift","python","ruby","php","cpp","kotlin"]'), github.event.inputs.sdk_name) }}
6188
run: |
6289
MARKDOWN_FILE="./$sdk_name/premium-ex.md"
6390
@@ -99,14 +126,26 @@ jobs:
99126
fi
100127
done
101128
102-
- name: Upload/Sync to S3
129+
- name: Upload/Sync to S3 (SDK languages)
130+
if: ${{ contains(fromJSON('["javascriptv3","dotnetv4","javav2","rustv1","gov2","swift","python","ruby","php","cpp","kotlin"]'), github.event.inputs.sdk_name) }}
103131
run: |
104132
for level in "basics" "feature-scenario" "complex-feature-scenario"; do
105133
if [ -d "./extracted_snippets/$level" ]; then
106134
aws s3 sync "./extracted_snippets/$level/" "s3://$S3_LANGUAGE-premium-bucket/$level/" --delete
107135
echo "Uploaded $level examples to S3"
108136
fi
109137
done
138+
139+
- name: Upload/Sync to S3 (Other directories)
140+
if: ${{ contains(fromJSON('["steering_docs","coding-standards","specs"]'), github.event.inputs.sdk_name) }}
141+
run: |
142+
if [ "$sdk_name" == "steering_docs" ]; then
143+
aws s3 sync "./$sdk_name/" "s3://$S3_LANGUAGE-bucket/" --delete
144+
elif [ "$sdk_name" == "coding-standards" ]; then
145+
aws s3 sync "./filtered-wiki/" "s3://$S3_LANGUAGE-bucket/" --delete
146+
else
147+
aws s3 sync "./filtered_specs/" "s3://$S3_LANGUAGE-bucket/" --delete
148+
fi
110149
111150
- name: Sync Knowledge Base Data Source
112151
run: |

.github/workflows/sync-steer-specs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: syncSteerSpecs
22
on:
33
push:
4-
branches: ["sync-for-steer-specs"]
4+
branches: ["main"]
55
workflow_dispatch:
66
inputs:
77
dir_name:

0 commit comments

Comments
 (0)