diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index a9cf24be98..3b30fa446e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -187,32 +187,33 @@ jobs: name: Combine needs: [build-docker, build-host, build-documentation] runs-on: ubuntu-22.04 - if: | - github.repository_owner == 'wpilibsuite' && - (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) + env: + main_or_release: github.repository_owner == 'wpilibsuite' && + (github.ref == 'refs/heads/main' || + startsWith(github.ref, 'refs/tags/v')) steps: - uses: actions/checkout@v3 + if: env.main_or_release == 'true' with: repository: wpilibsuite/build-tools - uses: actions/download-artifact@v3 + if: env.main_or_release == 'true' with: path: combiner/products/build/allOutputs - name: Flatten Artifacts + if: env.main_or_release == 'true' run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs/ - name: Check version number exists + if: env.main_or_release == 'true' run: | cat combiner/products/build/allOutputs/version.txt test -s combiner/products/build/allOutputs/version.txt - uses: actions/setup-java@v3 + if: env.main_or_release == 'true' with: distribution: 'zulu' java-version: 11 - - name: Combine - if: | - !startsWith(github.ref, 'refs/tags/v') && - github.ref != 'refs/heads/main' - run: cd combiner && ./gradlew publish -Pallwpilib - - name: Combine (Master) + - name: Combine (Main) if: | github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' @@ -231,6 +232,7 @@ jobs: ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} - uses: actions/upload-artifact@v3 + if: env.main_or_release == 'true' with: name: Maven path: ~/releases