Skip to content

Commit

Permalink
chore: add ci for generating + publishing schema.json
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlacy committed Apr 15, 2024
1 parent 54095c6 commit 75ab13d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/generate-schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Generate Schema"

on:
pull_request:

permissions:
contents: write
pull-requests: write

env:
DENO_DIR: ~/.deno-cache

jobs:
release:
runs-on: ubuntu-latest

strategy:
matrix:
deno-version: [1.41.3]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup Deno ${{ matrix.deno-version }}
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}
- name: Run generate-schema
run: deno task generate-schema
- name: Commit and push to pr
run: |
diff=$(git diff schema.json)
if [[ "${diff}" ]]; then
git config user.name github-actions
git config user.email [email protected]
git add schema.json
git commit -m 'chore(schema): generate'
git push
exit 0
fi
echo "skipping"
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.release.outputs.tag_name }} ./build/runreal-win-x64.exe ./build/runreal-macos-arm ./build/runreal-linux-x64
run: gh release upload ${{ steps.release.outputs.tag_name }} ./build/runreal-win-x64.exe ./build/runreal-macos-arm ./build/runreal-linux-x64 schema.json

- name: Cache Deno dependencies
if: ${{ steps.release.outputs.release_created }}
Expand Down

0 comments on commit 75ab13d

Please sign in to comment.