From 287f3b06cee916a2b36a5ccab7f914533144881e Mon Sep 17 00:00:00 2001 From: Matthew Pope Date: Fri, 4 Oct 2024 07:14:07 -0700 Subject: [PATCH] Adds build job for forked repos --- .github/workflows/build.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cb1b65..762b938 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,9 +12,27 @@ on: - '*.md' jobs: - # Build and test plugin and provide artifact. - build: + # Forks won't have codebuild runners set up, so they can't run the verifyPlugin commands + # Rather than have no CI for forks, we'll run the basic 'build' command + build-fork: + name: Build (fork) + if: github.repository != 'amazon-ion/ion-intellij-plugin' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: '17' + - uses: gradle/actions/setup-gradle@v4 + + # Build artifact using build Gradle task + - name: Build + run: ./gradlew build + + build-source: name: Build + if: github.repository == 'amazon-ion/ion-intellij-plugin' runs-on: codebuild-ion-intellij-plugin-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large steps: - uses: actions/checkout@v4 @@ -37,7 +55,7 @@ jobs: run: ./gradlew verifyPlugin publish-beta: - needs: build + needs: build-source if: github.repository == 'amazon-ion/ion-intellij-plugin' && github.ref == 'refs/heads/master' runs-on: codebuild-ion-intellij-plugin-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large steps: