From 82e65e758650eee1e06c8d20a563da228bb7de3b Mon Sep 17 00:00:00 2001 From: Curtis Rueden Date: Wed, 24 Jul 2024 12:10:51 -0500 Subject: [PATCH] CI: fix Windows build This patch does three things: 1. Consolidates the build-main and build-pr configs into one. 2. Fixes the Windows build to actually do something, by adding the needed `shell: bash` lines into the .yml configuration. 3. Skips the deployment for all platforms except Linux, to avoid double deploys / failing releases. --- .github/setup.sh | 7 ++++++ .github/workflows/build-pr.yml | 23 ------------------- .../workflows/{build-main.yml => build.yml} | 5 ++++ 3 files changed, 12 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/build-pr.yml rename .github/workflows/{build-main.yml => build.yml} (90%) diff --git a/.github/setup.sh b/.github/setup.sh index a03464be..0ebca586 100755 --- a/.github/setup.sh +++ b/.github/setup.sh @@ -1,3 +1,10 @@ #!/bin/sh curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-setup-github-actions.sh sh ci-setup-github-actions.sh + +# Let the Linux build handle artifact deployment. +if [ "$(uname)" != Linux ] +then + echo "No deploy -- non-Linux build" + echo "NO_DEPLOY=1" >> $GITHUB_ENV +fi diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml deleted file mode 100644 index ac5696fb..00000000 --- a/.github/workflows/build-pr.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: build PR - -on: - pull_request: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Java - uses: actions/setup-java@v2 - with: - java-version: '8' - distribution: 'zulu' - cache: 'maven' - - name: Set up CI environment - run: .github/setup.sh - - name: Execute the build - run: .github/build.sh diff --git a/.github/workflows/build-main.yml b/.github/workflows/build.yml similarity index 90% rename from .github/workflows/build-main.yml rename to .github/workflows/build.yml index f77cfd03..19b0851a 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,9 @@ on: - master tags: - "*-[0-9]+.*" + pull_request: + branches: + - master jobs: build: @@ -24,8 +27,10 @@ jobs: cache: 'maven' - name: Set up CI environment run: .github/setup.sh + shell: bash - name: Execute the build run: .github/build.sh + shell: bash env: GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}