From 6f2cec78615cb1b86d5f1bbf653809d5307beef1 Mon Sep 17 00:00:00 2001 From: Christian De Angelis Date: Sat, 9 Nov 2024 18:39:16 -0500 Subject: [PATCH] Automatically update lexicons --- .github/workflows/update_lexicons.yml | 54 +++++++++++++++++++++++++++ .gitignore | 3 ++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/update_lexicons.yml diff --git a/.github/workflows/update_lexicons.yml b/.github/workflows/update_lexicons.yml new file mode 100644 index 0000000..e76fe07 --- /dev/null +++ b/.github/workflows/update_lexicons.yml @@ -0,0 +1,54 @@ +name: Update Lexicons + +on: +# schedule: +# - cron: '0 0 * * *' + workflow_dispatch: + +jobs: + update-lexicons: + runs-on: ubuntu-latest + timeout-minutes: 15 + + permissions: + contents: write + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + check-latest: true + + - name: Clone atproto repository + uses: actions/checkout@v3 + with: + repository: bluesky-social/atproto + path: tmp-atproto + + - name: Overwrite lexicons + run: | + rm -rf lexicons/schemas + cp -R tmp-atproto/lexicons lexicons/schemas + + - name: Get Changed Files + uses: tj-actions/verify-changed-files@v20 + id: changed-files + + - name: List Changed Files + env: + CHANGED_FILES: ${{ steps.changed-files.outputs.changed_files }} + run: | + echo "Changed files: $CHANGED_FILES" + + - name: Smoke Test + if: steps.changed-files.outputs.files_changed == 'true' + run: ./gradlew clean apiDump :app:desktop:assemble --no-daemon --stacktrace + +# - name: Commit changes +# uses: stefanzweifel/git-auto-commit-action@v4 +# if: steps.changed-files.outputs.files_changed == 'true' +# with: +# commit_message: Update lexicons from atproto +# file_pattern: '*.api lexicons/schemas/**' diff --git a/.gitignore b/.gitignore index 4c5cb31..855c3cb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ Package.swift ### Project ### /docs /.kotlin/ + +### CI ### +tmp-atproto/