-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into release/showroom
- Loading branch information
Showing
243 changed files
with
30,047 additions
and
2,820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,8 @@ jobs: | |
matrix: | ||
platform: [flutter, ios, macos, electron, unity, rn] | ||
working_dir: [../dita/RTC-NG, ../en-US/dita/RTC-NG] | ||
staging_tag: ['', '-staging'] | ||
runs-on: ubuntu-latest | ||
name: ${{matrix.platform}}${{matrix.staging_tag}} ${{matrix.working_dir == '../en-US/dita/RTC-NG' && '(en)' || '(cn)'}} | ||
name: ${{matrix.platform}} ${{matrix.working_dir == '../en-US/dita/RTC-NG' && '(en)' || '(cn)'}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up python 3.8 | ||
|
@@ -28,8 +27,10 @@ jobs: | |
run: | | ||
if [[ ${{ matrix.working_dir }} == *en-US* ]]; then | ||
echo "language=en" >> $GITHUB_OUTPUT | ||
else | ||
echo "filename=${{matrix.platform}}_en_ng.json" >> $GITHUB_OUTPUT | ||
else | ||
echo "language=cn" >> $GITHUB_OUTPUT | ||
echo "filename=${{matrix.platform}}_cn_ng.json" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Get branch name | ||
id: branch-name | ||
|
@@ -42,28 +43,83 @@ jobs: | |
- name: Run ${{steps.matrix_vars.outputs.language}} JSON creation | ||
run: | | ||
cd xml2json | ||
echo "Running for ${{matrix.platform}} NG" | ||
if [[ "${{ matrix.staging_tag }}" == -staging ]]; then | ||
python xml2json${{matrix.staging_tag}}.py --working_dir ${{matrix.working_dir}} --platform_tag ${{matrix.platform}}; | ||
else | ||
python xml2json${{matrix.staging_tag}}.py --working_dir ${{matrix.working_dir}} --platform_tag ${{matrix.platform}} \ | ||
--json_file ${{matrix.platform}}_${{steps.matrix_vars.outputs.language}}_ng.json \ | ||
--sdk_type rtc-ng --remove_sdk_type rtc --defined_path ${{matrix.platform}}-ng; | ||
fi | ||
- name: Validate JSON File | ||
run: python -m json.tool "xml2json/${{matrix.platform}}_${{steps.matrix_vars.outputs.language}}_ng.json" > /dev/null | ||
python xml2json.py --working_dir ${{matrix.working_dir}} --platform_tag ${{matrix.platform}}\ | ||
--json_file ${{steps.matrix_vars.outputs.filename}}\ | ||
--language ${{steps.matrix_vars.outputs.language}} | ||
- name: Validate and Order JSON File | ||
run: jq 'sort_by(.'id')' "xml2json/${{steps.matrix_vars.outputs.filename}}" > ${{steps.matrix_vars.outputs.filename}} | ||
- name: Upload ${{matrix.platform}} ${{steps.matrix_vars.outputs.language}} Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{matrix.platform}}_ng_json_template_${{ steps.matrix_vars.outputs.language }}${{matrix.staging_tag}}.json | ||
path: xml2json/${{matrix.platform}}_${{steps.matrix_vars.outputs.language}}_ng.json | ||
name: ${{matrix.platform}}_ng_json_template_${{steps.matrix_vars.outputs.language}}.json | ||
path: ${{steps.matrix_vars.outputs.filename}} | ||
- name: Upload ${{matrix.platform}} NG ${{steps.matrix_vars.outputs.language}} JSON to release | ||
if: github.ref_name == github.event.repository.default_branch | ||
uses: svenstaro/[email protected] | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: xml2json/${{matrix.platform}}_${{steps.matrix_vars.outputs.language}}_ng.json | ||
asset_name: ${{matrix.platform}}_ng_json_template_${{steps.matrix_vars.outputs.language}}${{matrix.staging_tag}}.json | ||
tag: ${{ steps.branch-name.outputs.current_branch }}-build | ||
file: ${{steps.matrix_vars.outputs.filename}} | ||
asset_name: ${{matrix.platform}}_ng_json_template_${{steps.matrix_vars.outputs.language}}.json | ||
tag: ${{steps.branch-name.outputs.current_branch}}-build | ||
overwrite: true | ||
body: "Template file for automatic comment population." | ||
check_changed_files: | ||
name: Check xml2json updated | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
updated_xml: ${{steps.xml2json-changed.outputs.updated_xml}} | ||
steps: | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v37 | ||
- name: Output Bool | ||
id: xml2json-changed | ||
run: echo "updated_xml=${{contains(steps.changed-files.outputs.all_changed_files, 'xml2json/xml2json.py')}}" >> $GITHUB_OUTPUT | ||
compare: | ||
name: Compare JSON Files | ||
needs: [check_changed_files, build] | ||
if: needs.check_changed_files.outputs.updated_xml | ||
permissions: | ||
pull-requests: read | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: [flutter, ios, macos, electron, unity, rn] | ||
language: [en, cn] | ||
steps: | ||
- name: Set up python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
- name: Download DocC Archive ⬇️ | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{matrix.platform}}_ng_json_template_${{matrix.language}}.json | ||
path: artifacts | ||
- name: Download current release | ||
uses: robinraju/[email protected] | ||
with: | ||
tag: "master-build" | ||
fileName: ${{matrix.platform}}_ng_json_template_${{matrix.language}}.json | ||
- name: Check Sort by ID | ||
run: | | ||
# Sorting and moving newly generated JSON | ||
jq 'sort_by(.'id')' "artifacts/${{matrix.platform}}_${{matrix.language}}_ng.json" > ${{matrix.platform}}_${{matrix.language}}_new.json | ||
# mv artifacts/${{matrix.platform}}_${{matrix.language}}_ng.json ${{matrix.platform}}_${{matrix.language}}_new.json | ||
# Sorting and moving latest release JSON | ||
jq 'sort_by(.'id')' "${{matrix.platform}}_ng_json_template_${{matrix.language}}.json" > ${{matrix.platform}}_${{matrix.language}}_old.json | ||
- name: Make Diff Compare File | ||
run: | | ||
set -e; diff -u ${{matrix.platform}}_${{matrix.language}}_old.json ${{matrix.platform}}_${{matrix.language}}_new.json -U 3 | tee comparison.txt > /dev/null | ||
- name: Output Diff | ||
run: | | ||
if [[ ! -s comparison.txt ]]; then | ||
echo "No differences found." | ||
else | ||
echo """ | ||
\`\`\`diff | ||
$(cat comparison.txt) | ||
\`\`\` | ||
""" >> $GITHUB_STEP_SUMMARY | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.