diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 000000000..5eff974d7 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,118 @@ +# Gradle build and publish on tag +--- +name: Build + +on: + push: + pull_request: + schedule: + - cron: '0 0 * * 0' + +jobs: + build: + strategy: + matrix: + 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 }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Cache Gradle packages + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - 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 }} + - 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: | + choco uninstall innosetup + choco install innosetup --version=5.6.1 + ./gradlew packageApplicationExe + ./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: | + 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 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* + 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/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' + uses: actions/upload-artifact@v2 + with: + 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: artifacts/* + tag: ${{ github.ref }} + overwrite: true + file_glob: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 79dbd1d64..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: Build - -on: [push] - -jobs: - build: - strategy: - matrix: - java: [1.8, 11] - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - name: Cache Gradle packages - uses: actions/cache@v2 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - name: Build with Gradle - run: gradle build 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" 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