From 6bd33ef6aa4ee1078cd9cdb15c0d18425e261418 Mon Sep 17 00:00:00 2001 From: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> Date: Wed, 1 Jan 2025 10:10:41 -0700 Subject: [PATCH] feat: publish schema on tagged releases (#352) Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> --- .buildkite/pipeline.yaml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index 4f5d292c..9106de6b 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -117,7 +117,7 @@ steps: - label: ":github: upload reports" key: "scan-upload" cancel_on_build_failing: true - if: build.branch == "main" + if: build.branch == "main" && build.tag == null depends_on: ["go_test"] plugins: - cluster-secrets#v1.0.0: @@ -183,7 +183,7 @@ steps: dir: "file://db/migrations" step: lint - label: ":rocket: atlas push" - if: build.branch == "main" + if: build.branch == "main" && build.tag == null key: "atlas_migrate" plugins: - cluster-secrets#v1.0.0: @@ -240,7 +240,7 @@ steps: trivy-version: "0.57.1" - label: ":docker: docker build and publish" cancel_on_build_failing: true - if: build.branch == "main" + if: build.branch == "main" && build.tag == null commands: | #!/bin/bash ls @@ -278,7 +278,7 @@ steps: agents: queue: $LARGE_RUNNER_QUEUE size: $RUNNER_LARGE - if: build.branch == "main" + if: build.branch == "main" && build.tag == null cancel_on_build_failing: true commands: | #!/bin/bash @@ -360,3 +360,24 @@ steps: push: true build-args: - NAME=${APP_NAME} + - group: ":rocket: Publish" + key: "publish" + if: build.tag != null + steps: + - label: ":graphql: publish graphql schema" + key: "apollo-publish-schema" + cancel_on_build_failing: true + command: "rover graph publish --schema $$GRAPHQL_SCHEMA_LOCATION $$GRAPHQL_SCHEMA_NAME" + env: + GRAPHQL_SCHEMA_LOCATION: "internal/graphapi/clientschema/schema.graphql" + GRAPHQL_SCHEMA_NAME: "Openlane-2fwyqq@current" + plugins: + - cluster-secrets#v1.0.0: + variables: + APOLLO_KEY: APOLLO_KEY + - docker#v5.12.0: + image: "ghcr.io/theopenlane/build-image:latest" + always_pull: true + propagate-environment: true + environment: + - "APOLLO_KEY"