Skip to content

Commit

Permalink
feat(graphql): move schema to Github artifact
Browse files Browse the repository at this point in the history
Remove the generated schema from the repository and generate it
automatically on the CI.
  • Loading branch information
gligneul committed Sep 19, 2023
1 parent ffd2372 commit e6ca09c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ jobs:
- name: Run tests
run: cargo test

- name: Generate GraphQL schema
run: ./target/debug/generate-schema

- name: Upload GraphQL schema
uses: actions/upload-artifact@v3
with:
name: graphql-schema
path: offchain/schema.graphql
if-no-files-found: error

build_docker:
runs-on: ubuntu-22.04
needs:
Expand Down Expand Up @@ -116,3 +126,21 @@ jobs:
push: true
project: ${{ vars.DEPOT_PROJECT }}
workdir: build

release:
needs: [test, build_docker]
runs-on: ubuntu-22.04
steps:
- name: Download GraphQL schema
uses: actions/download-artifact@v3
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
name: graphql-schema

- name: Upload GraphQL schema to GitHub Release
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
draft: true
files: |
schema.graphql
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Standardized log libraries and configuration
- Moved GraphQL schema generation to the CI. Now it is distributed as a Github artifact

### Removed

Expand Down
File renamed without changes.

0 comments on commit e6ca09c

Please sign in to comment.