From fff56083d430ae9f52a217234eb26886868c1fa2 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 10 Dec 2020 17:09:08 +0000 Subject: [PATCH 1/8] add deployment --- .github/workflows/maven.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 3c5048f94d0..dc6842e663f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -32,3 +32,22 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Build run: mvn ${{ env.maven_commands }} + deploy: + if: contains('refs/heads/develop', github.ref) && startsWith(github.ref, 'refs/tags') != true + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Repository + uses: actions/setup-java@v1 + with: + java-version: 11 + server-id: ome.snapshots + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Deploy SNAPSHOT + run: mvn deploy + env: + MAVEN_USERNAME: ${{ secrets.CI_DEPLOY_USER }} + MAVEN_PASSWORD: ${{ secrets.CI_DEPLOY_PASS }} + From dbeb0e1ac40c200e54aec984cd995424998f45a3 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 10 Dec 2020 17:13:49 +0000 Subject: [PATCH 2/8] remove travis --- .travis.settings.xml | 18 ----------------- .travis.yml | 46 -------------------------------------------- 2 files changed, 64 deletions(-) delete mode 100644 .travis.settings.xml delete mode 100644 .travis.yml diff --git a/.travis.settings.xml b/.travis.settings.xml deleted file mode 100644 index 1d8af492610..00000000000 --- a/.travis.settings.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - ome.staging - ${env.CI_DEPLOY_USER} - ${env.CI_DEPLOY_PASS} - - - ome.snapshots - ${env.CI_DEPLOY_USER} - ${env.CI_DEPLOY_PASS} - - - - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 275d343a128..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -language: java - -# This (sudo: false) is needed to "run on container-based infrastructure" on -# which cache: is available -# http://docs.travis-ci.com/user/workers/container-based-infrastructure/ -sudo: false - -# http://docs.travis-ci.com/user/caching/#Arbitrary-directories -cache: - directories: - - $HOME/.m2 - - downloads - -addons: - apt: - packages: - - git - - ant - -jdk: - - openjdk11 - - openjdk8 - -env: - - BUILD=maven - - BUILD=ant - -matrix: - fast_finish: true - exclude: - - jdk: openjdk11 - env: BUILD=ant - -script: - - ./tools/test-build $BUILD - -deploy: - provider: script - script: "cp .travis.settings.xml $HOME/.m2/settings.xml && mvn deploy" - skip_cleanup: true - on: - jdk: openjdk11 - repo: ome/bioformats - branch: develop - tags: false From cbf1945ee850717c81b21f04e4f76f6306229d44 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 10 Dec 2020 17:15:44 +0000 Subject: [PATCH 3/8] rename so it can be easily included as badge --- .github/workflows/ant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index f0c74e612be..9179c3ba4ec 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -1,5 +1,5 @@ --- -name: Build with Ant +name: Ant on: [push, pull_request] From 60812b31ef93b04ebb02a1e92bbe06c0e9e5af8a Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 10 Dec 2020 17:16:55 +0000 Subject: [PATCH 4/8] add badges --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0f34b1db38..530c705860e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Bio-Formats -[![Build Status](https://travis-ci.org/ome/bioformats.png)](https://travis-ci.org/ome/bioformats) +[![Actions Status](https://github.com/ome/bioformats/workflows/Ant/badge.svg)](https://github.com/ome/bioformats/actions) +[![Actions Status](https://github.com/ome/bioformats/workflows/Maven/badge.svg)](https://github.com/ome/bioformats/actions) Bio-Formats is a standalone Java library for reading and writing life sciences image file formats. It is capable of parsing both pixels and metadata for a From 6102d4f7551949bf3dc0681bc7c5f4221626c4c0 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 10 Dec 2020 17:56:55 +0000 Subject: [PATCH 5/8] remove check --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index dc6842e663f..43cca0bcf3f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -33,7 +33,7 @@ jobs: - name: Build run: mvn ${{ env.maven_commands }} deploy: - if: contains('refs/heads/develop', github.ref) && startsWith(github.ref, 'refs/tags') != true + if: contains('refs/heads/develop', github.ref) needs: build runs-on: ubuntu-latest steps: From 4ced65be469273182a737b8a42136c30823b0956 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 10 Dec 2020 18:11:50 +0000 Subject: [PATCH 6/8] switch to 1.8 --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 43cca0bcf3f..5f777329507 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -41,7 +41,7 @@ jobs: - name: Set up Repository uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 1.8 server-id: ome.snapshots server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD From 24f0bad039490e6554978c7e7d691d966a2da99f Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 10 Dec 2020 21:08:14 +0000 Subject: [PATCH 7/8] handle staging and snapshots --- .github/workflows/maven.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 5f777329507..b8c108f702d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -33,16 +33,24 @@ jobs: - name: Build run: mvn ${{ env.maven_commands }} deploy: - if: contains('refs/heads/develop', github.ref) + if: contains('refs/heads/develop', github.ref) || startsWith(github.ref, 'refs/tags') needs: build runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Get server + id: get_server + run: | + if [${{ github.ref }} == 'refs/heads/develop']; then + echo ::set-output name=server::'ome.snapshots' + else + echo ::set-output name=server::'ome.staging' + fi - name: Set up Repository uses: actions/setup-java@v1 with: java-version: 1.8 - server-id: ome.snapshots + server-id: ${{ steps.get_server.outputs.server }} server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Deploy SNAPSHOT From 4bdd1f610fe26f5f4f534d697f0c918f2535c2a1 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 10 Dec 2020 22:50:26 +0000 Subject: [PATCH 8/8] extract version from pom --- .github/workflows/maven.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b8c108f702d..1899b2782b8 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -33,15 +33,20 @@ jobs: - name: Build run: mvn ${{ env.maven_commands }} deploy: - if: contains('refs/heads/develop', github.ref) || startsWith(github.ref, 'refs/tags') + if: contains('refs/heads/develop', github.ref) needs: build runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Get server - id: get_server + - name: Retrieve version + id: get_version run: | - if [${{ github.ref }} == 'refs/heads/develop']; then + VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout ) + echo "::set-output name=version::$VERSION" + - name: Set server + id: set_server + run: | + if [[ ${{ steps.get_version.outputs.version }} =~ 'SNAPSHOT' ]]; then echo ::set-output name=server::'ome.snapshots' else echo ::set-output name=server::'ome.staging' @@ -50,7 +55,7 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - server-id: ${{ steps.get_server.outputs.server }} + server-id: ${{ steps.set_server.outputs.server }} server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Deploy SNAPSHOT