From 6c38912dead7bceb052e14b6f34a4f3576e55b23 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Sep 2025 21:37:53 +0000 Subject: [PATCH 1/2] Initial plan From 55fd7416f837219c7faa750d2ba1ebb370e997e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Sep 2025 21:41:17 +0000 Subject: [PATCH 2/2] Add auto-build artifacts workflow for schema updates Co-authored-by: shreddd <143514+shreddd@users.noreply.github.com> --- .github/workflows/auto-build-artifacts.yaml | 70 +++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/auto-build-artifacts.yaml diff --git a/.github/workflows/auto-build-artifacts.yaml b/.github/workflows/auto-build-artifacts.yaml new file mode 100644 index 0000000..c5b56a3 --- /dev/null +++ b/.github/workflows/auto-build-artifacts.yaml @@ -0,0 +1,70 @@ +name: Auto-build artifacts on schema update + +on: + push: + branches: + - main + - develop + paths: + - 'src/schema/linkml/**' + pull_request: + paths: + - 'src/schema/linkml/**' + +jobs: + build-artifacts: + runs-on: ubuntu-latest + if: ${{ !contains(github.event.head_commit.message, '[skip artifacts]') }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Set up Python 3.12 + uses: actions/setup-python@v4 + with: + python-version: 3.12 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + + - name: Install dependencies + run: | + uv sync + + - name: Generate artifacts + run: | + make gen-artefacts + + - name: Check for changes + id: check_changes + run: | + git add src/schema/jsonschema/ src/schema/datamodel/ + if git diff --staged --quiet; then + echo "changes=false" >> $GITHUB_OUTPUT + else + echo "changes=true" >> $GITHUB_OUTPUT + fi + + - name: Commit and push changes + if: steps.check_changes.outputs.changes == 'true' && github.event_name == 'push' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m "Auto-generate artifacts from schema update [skip artifacts]" + git push + + - name: Add PR comment for artifact changes + if: steps.check_changes.outputs.changes == 'true' && github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '🤖 **Artifacts will be auto-generated** when this PR is merged due to schema changes in `src/schema/linkml/`.' + }) \ No newline at end of file