From 81fe151cd814485b0e8c78d4ec82e75a069e3630 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Fri, 27 Nov 2020 16:23:55 +0000 Subject: [PATCH 01/11] update file --- .github/workflows/main.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79dbd1d64..941ab74eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,11 @@ --- -name: Build +name: Gradle -on: [push] +on: + push: + pull_request: + schedule: + - cron: '0 0 * * 0' jobs: build: @@ -10,6 +14,9 @@ jobs: java: [1.8, 11] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} + env: + gradle_version: 5.2.1 # set to empty to build with most recent version of gradle + gradle_commands: build # default is build steps: - uses: actions/checkout@v2 - name: Set up JDK ${{ matrix.java }} @@ -22,5 +29,11 @@ jobs: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - - name: Build with Gradle - run: gradle build + - name: Wrap with specified version + run: gradle wrapper --gradle-version=${{ env.gradle_version }} + if: ${{ env.gradle_version != '' }} + - name: Wrap without version + run: gradle wrapper + if: ${{ env.gradle_version == '' }} + - name: Run commands + run: ./gradlew ${{ env.gradle_commands }} From bd3ff5b2b99250e1c4c7296cd0384ac6cf6c7c5a Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Fri, 27 Nov 2020 16:24:24 +0000 Subject: [PATCH 02/11] rename --- .github/workflows/{main.yml => gradle.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{main.yml => gradle.yml} (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/gradle.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/gradle.yml From 1acf52405e6ee1be41d214c8e1440ec0b0ed3558 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 30 Nov 2020 20:29:35 +0000 Subject: [PATCH 03/11] publish artifacts on tag --- .github/workflows/gradle.yml | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 941ab74eb..8cff32735 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -37,3 +37,54 @@ jobs: if: ${{ env.gradle_version == '' }} - name: Run commands run: ./gradlew ${{ env.gradle_commands }} + - name: Build Executable + if: startsWith(matrix.os, 'windows') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' + run: | + choco uninstall innosetup + choco install innosetup --version=5.6.1 + ./gradlew packageApplicationExe + ./gradlew packageImporterApplicationExe + - name: Build Dmg + if: startsWith(matrix.os, 'macos') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' + run: | + brew cask install zulu8 + export JAVA_HOME='/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home' + export PATH=$JAVA_HOME/bin:$PATH + ./gradlew packageApplicationDmg + ./gradlew packageImporterApplicationDmg + - name: Upload zip + if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/distributions/OMERO* + tag: ${{ github.ref }} + overwrite: true + file_glob: true + - name: Upload jar + if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/libs/omero_* + tag: ${{ github.ref }} + overwrite: true + file_glob: true + - name: Upload insight artifacts + if: startsWith(matrix.os, 'ubuntu') != true && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/packaged/main/bundles/* + tag: ${{ github.ref }} + overwrite: true + file_glob: true + - name: Upload importer artifacts + if: startsWith(matrix.os, 'ubuntu') != true && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/packaged/installImporterDist/bundles/* + tag: ${{ github.ref }} + overwrite: true + file_glob: true From ff60d21a0592125fae70983b5022b415a43cf760 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 30 Nov 2020 22:27:13 +0000 Subject: [PATCH 04/11] remove travis file --- .travis.yml | 91 ----------------------------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e6a017fce..000000000 --- a/.travis.yml +++ /dev/null @@ -1,91 +0,0 @@ -jobs: - include: - - os: osx - language: java - osx_image: xcode9.3 - before_install: - - brew update - - brew install gradle - install: - - DIR=$PWD; (cd /tmp; gradle wrapper --gradle-version=5.2.1; mv .gradle gradle gradlew $DIR) - script: - - travis_retry ./gradlew packageApplicationDmg - - if [[ -n "$TRAVIS_TAG" ]]; then travis_retry ./gradlew packageImporterApplicationDmg ; fi - - test -f build/packaged/main/bundles/OMERO.insight-* - - os: linux - language: java - install: - - DIR=$PWD; (cd /tmp; gradle wrapper --gradle-version=5.2.1; mv .gradle gradle gradlew $DIR) - script: - - ./gradlew build - - test -f build/libs/omero_ij* - - test -f build/distributions/OMERO.insight-* - - os: windows - language: sh - before_install: - - choco install gradle - - choco install jdk8 - - choco install innosetup --version=5.6.1 - - export PATH="/c/Program Files/Java/jdk1.8.0_211:/c/ProgramData/chocolatey/lib/gradle/tools:$PATH" - - export PATH="/c/Program Files (x86)/Inno Setup 5:$PATH" - - export JAVA_HOME="/c/Program Files/Java/jdk1.8.0_211" - - export GRADLE_OPTS="-Dorg.gradle.daemon=false" - - choco install nuget.commandline - - DIR=$PWD - - cd "C:\Program Files (x86)" - - nuget install WiX - - export PATH="/c/Program Files (x86)/WiX.3.11.2/tools:$PATH" - - cd $DIR - install: - - DIR=$PWD - - rm -rf $HOME/.gradle - - gradle wrapper --gradle-version=5.2.1 - - mv .gradle gradle gradlew $DIR - script: - - travis_retry ./gradlew packageApplicationExe - - test -f build/packaged/main/bundles/OMERO.insight-* - - if [[ -n "$TRAVIS_TAG" ]]; then travis_retry ./gradlew packageApplicationMsi ; fi - - if [[ -n "$TRAVIS_TAG" ]]; then travis_retry ./gradlew packageImporterApplicationMsi ; fi - - if [[ -n "$TRAVIS_TAG" ]]; then travis_retry ./gradlew packageImporterApplicationExe ; fi - -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - -deploy: - - provider: releases - api_key: $GITHUB_OAUTH_TOKEN - file_glob: true - file: build/libs/omero_* - skip_cleanup: true - on: - tags: true - condition: "$TRAVIS_OS_NAME = linux" - - provider: releases - api_key: $GITHUB_OAUTH_TOKEN - file_glob: true - file: build/distributions/OMERO* - skip_cleanup: true - on: - tags: true - condition: "$TRAVIS_OS_NAME = linux" - - provider: releases - api_key: $GITHUB_OAUTH_TOKEN - file_glob: true - file: build/packaged/main/bundles/* - skip_cleanup: true - on: - tags: true - condition: "$TRAVIS_OS_NAME != linux" - - provider: releases - api_key: $GITHUB_OAUTH_TOKEN - file_glob: true - file: build/packaged/installImporterDist/bundles/* - skip_cleanup: true - on: - tags: true - condition: "$TRAVIS_OS_NAME != linux" From c90b026e31457b93621fef16c090d5f449bf55dd Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 1 Dec 2020 12:17:54 +0000 Subject: [PATCH 05/11] build msi --- .github/workflows/gradle.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 8cff32735..a707269be 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -37,6 +37,10 @@ jobs: if: ${{ env.gradle_version == '' }} - name: Run commands run: ./gradlew ${{ env.gradle_commands }} + - name: Prepare PATH + if: startsWith(matrix.os, 'windows') + shell: bash + run: echo "$WIX\\bin" >> $GITHUB_PATH - name: Build Executable if: startsWith(matrix.os, 'windows') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' run: | @@ -44,6 +48,8 @@ jobs: choco install innosetup --version=5.6.1 ./gradlew packageApplicationExe ./gradlew packageImporterApplicationExe + ./gradlew packageApplicationMsi + ./gradlew packageImporterApplicationMsi - name: Build Dmg if: startsWith(matrix.os, 'macos') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' run: | From 853e812990f71b3f7910d7da08f8616b993b1997 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 1 Dec 2020 12:19:04 +0000 Subject: [PATCH 06/11] change name --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index a707269be..17bb24164 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,5 +1,5 @@ --- -name: Gradle +name: Gradle build and publish on tag on: push: From ff40324acd59c5b72489a29d6a0d839b36d98141 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 3 Dec 2020 20:24:52 +0000 Subject: [PATCH 07/11] review release logic --- .github/workflows/gradle.yml | 47 +++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 17bb24164..750363196 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -60,37 +60,46 @@ jobs: ./gradlew packageImporterApplicationDmg - name: Upload zip if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' - uses: svenstaro/upload-release-action@v2 + uses: actions/upload-artifact@v2 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/distributions/OMERO* - tag: ${{ github.ref }} - overwrite: true - file_glob: true + name: artifacts + path: build/distributions/OMERO* + if-no-files-found: error - name: Upload jar if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' - uses: svenstaro/upload-release-action@v2 + uses: actions/upload-artifact@v2 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/libs/omero_* - tag: ${{ github.ref }} - overwrite: true - file_glob: true + name: artifacts + path: build/distributions/OMERO* + if-no-files-found: error - name: Upload insight artifacts if: startsWith(matrix.os, 'ubuntu') != true && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' - uses: svenstaro/upload-release-action@v2 + uses: actions/upload-artifact@v2 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/packaged/main/bundles/* - tag: ${{ github.ref }} - overwrite: true - file_glob: true + name: artifacts + path: build/packaged/main/bundles/* + if-no-files-found: error - name: Upload importer artifacts if: startsWith(matrix.os, 'ubuntu') != true && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' + uses: actions/upload-artifact@v2 + with: + name: artifacts + path: build/packaged/installImporterDist/bundles/* + + release: + if: startsWith(github.ref, 'refs/tags') + needs: build + runs-on: ubuntu-latest + steps: + - name: Download artifacts from build + uses: actions/download-artifact@v2 + - name: List artifacts + run: ls -R + - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/packaged/installImporterDist/bundles/* + file: artifacts/* tag: ${{ github.ref }} overwrite: true file_glob: true From f517b19c0fd9675cf4183fcab3480bf725e32a36 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 8 Dec 2020 22:12:24 +0000 Subject: [PATCH 08/11] add check if msi are created --- .github/workflows/gradle.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 750363196..1d2f0bfbf 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -50,6 +50,18 @@ jobs: ./gradlew packageImporterApplicationExe ./gradlew packageApplicationMsi ./gradlew packageImporterApplicationMsi + - name: Check MSI + if: startsWith(matrix.os, 'windows') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' + run: | + msi=(`find build/packaged/installImporterDist/bundles -maxdepth 1 -name "*.msi"`) + if [ ${#msi[@]} == 0 ]; then + exit 1 + fi + msi=(`find build/packaged/main/bundles -maxdepth 1 -name "*.msi"`) + if [ ${#msi[@]} == 0 ]; then + exit 1 + fi + shell: bash - name: Build Dmg if: startsWith(matrix.os, 'macos') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' run: | From 45ef33a10b9f9be0c5b5f5d1a79cb430ca2268e3 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 8 Dec 2020 22:13:57 +0000 Subject: [PATCH 09/11] add badge --- .github/workflows/gradle.yml | 3 ++- README.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1d2f0bfbf..6b1c1bd57 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,5 +1,6 @@ +# Gradle build and publish on tag --- -name: Gradle build and publish on tag +name: Build on: push: diff --git a/README.md b/README.md index 129f5f4b1..178940206 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ OMERO.insight Project --------------------- + [![Actions Status](https://github.com/ome/omero-insight/workflows/Build/badge.svg)](https://github.com/ome/omero-insight/actions) + The OMERO.insight Project is a sub-project of the Open Microscopy Environment Project, [OME](https://www.openmicroscopy.org/) that focuses on delivering a client for the visualization and manipulation of both image data and metadata From 1b77ae0b54058dc43a747610d3677d2abe87373c Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 9 Dec 2020 16:40:26 +0000 Subject: [PATCH 10/11] upload ij jar --- .github/workflows/gradle.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 6b1c1bd57..f140f8ade 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -71,12 +71,14 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH ./gradlew packageApplicationDmg ./gradlew packageImporterApplicationDmg - - name: Upload zip + - name: Upload zip and jar if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' uses: actions/upload-artifact@v2 with: name: artifacts - path: build/distributions/OMERO* + path: | + build/distributions/OMERO* + build/libs/omero_* if-no-files-found: error - name: Upload jar if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' From 56841cac29552fbbaf239fd023f3e646fa0db03a Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 9 Dec 2020 21:12:21 +0000 Subject: [PATCH 11/11] fix upload path --- .github/workflows/gradle.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index f140f8ade..5eff974d7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -76,16 +76,14 @@ jobs: uses: actions/upload-artifact@v2 with: name: artifacts - path: | - build/distributions/OMERO* - build/libs/omero_* + path: build/distributions/OMERO* if-no-files-found: error - name: Upload jar if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8' uses: actions/upload-artifact@v2 with: name: artifacts - path: build/distributions/OMERO* + path: build/libs/omero_* if-no-files-found: error - name: Upload insight artifacts if: startsWith(matrix.os, 'ubuntu') != true && startsWith(github.ref, 'refs/tags') && matrix.java == '1.8'