From ffd2372338d6c65a0f2b752febf282c141f85280 Mon Sep 17 00:00:00 2001 From: Gabriel de Quadros Ligneul <8294320+gligneul@users.noreply.github.com> Date: Tue, 19 Sep 2023 14:27:14 -0300 Subject: [PATCH 1/3] fix: typo in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a831219e0..904e3a42c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - Removed configurable inspect-server path prefix -- Remove on-chain code from the node repository +- Removed on-chain code from the node repository - Removed `advance-runner`, `dispatcher`, `graphql-server`, `host-runner`, `inspect-server`, `indexer`, and `state-server` docker images ## [1.0.2] 2023-09-12 From 990bc857dd10d8ad6a86a6b89eb61922711192e8 Mon Sep 17 00:00:00 2001 From: Gabriel de Quadros Ligneul <8294320+gligneul@users.noreply.github.com> Date: Tue, 19 Sep 2023 14:41:09 -0300 Subject: [PATCH 2/3] feat(graphql): move schema to Github artifact Remove the generated schema from the repository and generate it automatically on the CI. --- .github/workflows/build.yml | 28 +++++++++++++++++++- CHANGELOG.md | 1 + offchain/{graphql-server => }/schema.graphql | 0 3 files changed, 28 insertions(+), 1 deletion(-) rename offchain/{graphql-server => }/schema.graphql (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe6252fc7..f37b264d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ concurrency: permissions: packages: write id-token: write - contents: read + contents: write jobs: test: @@ -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: @@ -116,3 +126,19 @@ jobs: push: true project: ${{ vars.DEPOT_PROJECT }} workdir: build + + release: + needs: [test, build_docker] + runs-on: ubuntu-22.04 + if: startsWith(github.ref, 'refs/tags/v') + steps: + - name: Download GraphQL schema + uses: actions/download-artifact@v3 + with: + name: graphql-schema + + - name: Publish Github release + uses: softprops/action-gh-release@v1 + with: + prerelease: true + files: schema.graphql diff --git a/CHANGELOG.md b/CHANGELOG.md index 904e3a42c..5b00164a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/offchain/graphql-server/schema.graphql b/offchain/schema.graphql similarity index 100% rename from offchain/graphql-server/schema.graphql rename to offchain/schema.graphql From 5a7c4a77032281dfab103e724b065b94b937118c Mon Sep 17 00:00:00 2001 From: Gabriel de Quadros Ligneul <8294320+gligneul@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:35:22 -0300 Subject: [PATCH 3/3] feat: add changelog to the Github release --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f37b264d3..8a5bd075d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -132,6 +132,13 @@ jobs: runs-on: ubuntu-22.04 if: startsWith(github.ref, 'refs/tags/v') steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Trim CHANGELOG.md + run: sed -e '0,/^##[^#]/d' -e '/^##[^#]/,$d' -i CHANGELOG.md + - name: Download GraphQL schema uses: actions/download-artifact@v3 with: @@ -141,4 +148,5 @@ jobs: uses: softprops/action-gh-release@v1 with: prerelease: true + body_path: CHANGELOG.md files: schema.graphql