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 fa3f4df
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
permissions:
packages: write
id-token: write
contents: read
contents: write

jobs:
test:
Expand Down 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,20 @@ 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 fa3f4df

Please sign in to comment.