From a5f0b79b5949bc7751782cec73e89349d8461316 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 11:45:40 +0100 Subject: [PATCH 01/20] add issue --- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000000..1e22f3b0298 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +--- +name: Publish packages + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Assets + run: | + set -x + assets=() + for asset in ./artifacts/*.jar; do + assets+=("-a" "$asset") + done + tag_name="${GITHUB_REF##*/}" + hub release create "${assets[@]}" -m "$tag_name" "$tag_name" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From dedba6d39a26ac9b3e554c3d07381b38ae6dd78e Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 11:54:08 +0100 Subject: [PATCH 02/20] rename --- .github/workflows/{main.yml => release.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{main.yml => release.yml} (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/release.yml From 1b122a2d3c1b046bf7f0de5e40446c6d721b5dda Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 12:00:05 +0100 Subject: [PATCH 03/20] build with ant and maven --- .github/workflows/main.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000000..cf2de47f461 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +--- +name: Publish packages + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + java: [1.8, 11] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Build with Maven + run: ./tools/test-build maven + - name: Build with Ant + run: ./tools/test-build ant From 65a6d407a6ae37f82998d31c01885bde926a3403 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 12:11:53 +0100 Subject: [PATCH 04/20] change name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf2de47f461..79b4ac3f223 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: java: [1.8, 11] steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v1 with: java-version: ${{ matrix.java }} From 8b1c1f2cba2dca0090b6428655ca6dd620b8229a Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 12:39:19 +0100 Subject: [PATCH 05/20] upload artifacts --- .github/workflows/release.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e22f3b0298..f062c5a228f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,21 +12,13 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK 11 uses: actions/setup-java@v1 with: - java-version: 1.8 - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - name: Upload Release Assets + java-version: 11 + - name: Build artifacts + run: ./tools/test-build ant + - name: Create and Upload Release Assets run: | set -x assets=() From 354dcd9ba05ce1871322c60f2bbd22b39537541b Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 14:07:10 +0100 Subject: [PATCH 06/20] add matrix --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79b4ac3f223..7ba1e33a7e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,14 +1,15 @@ --- -name: Publish packages +name: Build with Maven and Ant -on: [push] +on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest strategy: matrix: java: [1.8, 11] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - name: Set up JDK ${{ matrix.java }} From 90ecc9f789f8f1edacb3331f1040c107acf18296 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 14:07:21 +0100 Subject: [PATCH 07/20] change name --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f062c5a228f..12df6535f50 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ --- -name: Publish packages +name: Build and publish packages on: push: From d1e1ab09fa0dd1bb76ca4cc6dca4ceed996513d4 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 15:20:02 +0100 Subject: [PATCH 08/20] make py3 compatible --- tools/source-archive.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/source-archive.py b/tools/source-archive.py index 1a6e7b50315..85544543af7 100755 --- a/tools/source-archive.py +++ b/tools/source-archive.py @@ -6,10 +6,8 @@ import os from subprocess import call import sys -import time import zipfile import tarfile -import StringIO import platform # This script archives the base tree and repacks it into a single zip which is @@ -163,7 +161,7 @@ basetar.close() try: call(['xz', "%s/%s.tar" % (options.target, prefix)]) - except: + except Exception: # This is expected to fail on Windows when xz is unavailable, # but is always an error on all other platforms. if platform.system() != 'Windows': From e755122da973a434403569543cd2ed5cf250a201 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 15:37:00 +0100 Subject: [PATCH 09/20] generate sha256 --- .github/workflows/release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 12df6535f50..557a133f5e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,14 +17,19 @@ jobs: with: java-version: 11 - name: Build artifacts - run: ./tools/test-build ant + run: | + ./tools/test-build ant + ant release - name: Create and Upload Release Assets run: | set -x assets=() - for asset in ./artifacts/*.jar; do + touch SHASUMS + for asset in ./artifacts/*; do assets+=("-a" "$asset") + sha256sum $asset >> SHASUMS done + assets+=("-a" SHASUMS) tag_name="${GITHUB_REF##*/}" hub release create "${assets[@]}" -m "$tag_name" "$tag_name" env: From b099cb256f7c6b7352c3b4cc51f3c5b6e30caaf9 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 16:24:46 +0100 Subject: [PATCH 10/20] add filename in shasums --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 557a133f5e4..8f87d065755 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,10 @@ jobs: touch SHASUMS for asset in ./artifacts/*; do assets+=("-a" "$asset") - sha256sum $asset >> SHASUMS + filename=$(basename -- "$asset") + value=$(sha256sum $asset) + IFS=' ' read -r -a array <<< "$value" + echo "${array[0]} $filename" >> SHASUMS done assets+=("-a" SHASUMS) tag_name="${GITHUB_REF##*/}" From cd54f1a88a44bc19231e58e7b2b991fdd253ac6f Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 20:08:48 +0100 Subject: [PATCH 11/20] add md5 --- .github/workflows/release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f87d065755..b20389f94e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,14 +25,19 @@ jobs: set -x assets=() touch SHASUMS + touch MD5 for asset in ./artifacts/*; do assets+=("-a" "$asset") filename=$(basename -- "$asset") - value=$(sha256sum $asset) - IFS=' ' read -r -a array <<< "$value" + sha=$(sha256sum $asset) + IFS=' ' read -r -a array <<< "$sha" echo "${array[0]} $filename" >> SHASUMS + md5=$(md5sum $asset) + IFS=' ' read -r -a array <<< "$md5" + echo "${array[0]} $filename" >> MD5 done assets+=("-a" SHASUMS) + assets+=("-a" MD5) tag_name="${GITHUB_REF##*/}" hub release create "${assets[@]}" -m "$tag_name" "$tag_name" env: From 2b1d2e6555a630a886d556379be73b44e6e72086 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 21:30:51 +0100 Subject: [PATCH 12/20] check windows --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7ba1e33a7e9..45180404b21 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: java: [1.8, 11] - os: [ubuntu-latest] + os: [ubuntu-latest, windows-2016] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 From a3563d43d9bed5683d1b19ba8a896d83775267ac Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 21:45:36 +0100 Subject: [PATCH 13/20] adjust tests --- .../test/loci/formats/utests/FormatToolsTest.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/components/formats-api/test/loci/formats/utests/FormatToolsTest.java b/components/formats-api/test/loci/formats/utests/FormatToolsTest.java index fea83375b26..08460bbbdc8 100644 --- a/components/formats-api/test/loci/formats/utests/FormatToolsTest.java +++ b/components/formats-api/test/loci/formats/utests/FormatToolsTest.java @@ -32,6 +32,7 @@ package loci.formats.utests; +import java.io.File; import loci.common.Constants; import loci.formats.FormatTools; @@ -44,6 +45,7 @@ import org.testng.annotations.Test; + /** * Unit tests for {@link loci.formats.FormatTools}. */ @@ -262,6 +264,13 @@ public void testParseLength(String value, String unit, Length length) { @Test(dataProvider = "fileLists") public void testGetRequiredDirectories(String[] files, int number) { - assertEquals(number, FormatTools.getRequiredDirectories(files)); + String[] newfiles = null; + if (files != null) { + newfiles = new String[files.length]; + for (int i = 0; i < files.length; i++) { + newfiles[i] = files[i].replace('/', File.separatorChar); + } + } + assertEquals(number, FormatTools.getRequiredDirectories(newfiles)); } } From 2c7b054ecaf7b59f93c735eeaec703696299995b Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 14 Oct 2020 22:03:19 +0100 Subject: [PATCH 14/20] using windows-latest --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 45180404b21..3a7759e766f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: java: [1.8, 11] - os: [ubuntu-latest, windows-2016] + os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 From 6e309bd098574eb44ed72c4f3424d205f767368d Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 15 Oct 2020 08:25:11 +0100 Subject: [PATCH 15/20] generate the docs --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b20389f94e3..f6471141a5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,7 @@ jobs: run: | ./tools/test-build ant ant release + ant docs - name: Create and Upload Release Assets run: | set -x From 3316c1f8a72facf9b11f1084e87218229f301005 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 15 Oct 2020 14:25:43 +0100 Subject: [PATCH 16/20] make py3 compatible --- tools/bump_maven_version.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/bump_maven_version.py b/tools/bump_maven_version.py index ae143167dd3..56256323b98 100755 --- a/tools/bump_maven_version.py +++ b/tools/bump_maven_version.py @@ -9,7 +9,7 @@ def check_version_format(version): """Check format of version number""" - pattern = '^[0-9]+[\.][0-9]+[\.][0-9]+(\-.+)*$' + pattern = r'^[0-9]+[\.][0-9]+[\.][0-9]+(\-.+)*$' return re.match(pattern, version) is not None @@ -18,6 +18,7 @@ def check_version_format(version): ".*pom-bio-formats\n" ".*).*()") + class Replacer(object): def __init__(self, old_group="ome", new_group="ome"): @@ -76,7 +77,7 @@ def bump_stable_version(self, version): ns = parser.parse_args() if not check_version_format(ns.version): - print "Invalid version format" + print("Invalid version format") sys.exit(1) replacer = Replacer(old_group=ns.old_group, new_group=ns.new_group) From ec4e40e00f2ce833ae54fbc21f3a97303de82356 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 15 Oct 2020 17:10:42 +0100 Subject: [PATCH 17/20] change url --- components/formats-bsd/src/loci/formats/UpgradeChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/formats-bsd/src/loci/formats/UpgradeChecker.java b/components/formats-bsd/src/loci/formats/UpgradeChecker.java index f487f0820d6..b7a0ef4df85 100644 --- a/components/formats-bsd/src/loci/formats/UpgradeChecker.java +++ b/components/formats-bsd/src/loci/formats/UpgradeChecker.java @@ -85,7 +85,7 @@ public class UpgradeChecker { * Location of the JAR artifacts for the stable releases. */ public static final String STABLE_BUILD = - "http://downloads.openmicroscopy.org/bio-formats/" + STABLE_VERSION + "/artifacts/"; + "http://downloads.openmicroscopy.org/bio-formats/"; /** Name of the ueber tools JAR. */ public static final String TOOLS = "bioformats_package.jar"; From 03df3980f9f86a242d5bd2c9512cc65175bf8850 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 27 Oct 2020 15:34:11 +0000 Subject: [PATCH 18/20] fix url --- components/formats-bsd/src/loci/formats/UpgradeChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/formats-bsd/src/loci/formats/UpgradeChecker.java b/components/formats-bsd/src/loci/formats/UpgradeChecker.java index b7a0ef4df85..4c8aedb2ee2 100644 --- a/components/formats-bsd/src/loci/formats/UpgradeChecker.java +++ b/components/formats-bsd/src/loci/formats/UpgradeChecker.java @@ -85,7 +85,7 @@ public class UpgradeChecker { * Location of the JAR artifacts for the stable releases. */ public static final String STABLE_BUILD = - "http://downloads.openmicroscopy.org/bio-formats/"; + "http://downloads.openmicroscopy.org/bio-formats/latest/artifacts/"; /** Name of the ueber tools JAR. */ public static final String TOOLS = "bioformats_package.jar"; From 9713aee7c8f6a9b10d487b8fea66118d100392a4 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 27 Oct 2020 15:39:12 +0000 Subject: [PATCH 19/20] add deprecated --- components/formats-bsd/src/loci/formats/UpgradeChecker.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/formats-bsd/src/loci/formats/UpgradeChecker.java b/components/formats-bsd/src/loci/formats/UpgradeChecker.java index 4c8aedb2ee2..57c5de64c69 100644 --- a/components/formats-bsd/src/loci/formats/UpgradeChecker.java +++ b/components/formats-bsd/src/loci/formats/UpgradeChecker.java @@ -64,6 +64,9 @@ public class UpgradeChecker { // -- Constants -- /** Version number of the latest stable release. */ + /** + * @deprecated As of release 6.6.0 + */ public static final String STABLE_VERSION = "6.5.1"; /** Location of the OME continuous integration server. */ From 5556451c133a936d15fcf90089dc17f41c4c9c8e Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 2 Nov 2020 20:18:29 +0000 Subject: [PATCH 20/20] remove file not used --- .appveyor.yml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index e33500d44fe..00000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,35 +0,0 @@ -environment: - AV_PROJECTS: 'c:\projects' - AV_BF_M2: 'c:\projects\m2' - AV_BF_SOURCE: 'c:\projects\bioformats' - -# Note that only Oracle JDK is provided. - matrix: - - java: 11 - build: maven - - java: 1.8 - build: maven - - java: 1.8 - build: ant - ant_version: 1.10.1 - -cache: - - '%AV_BF_M2% -> appveyor.yml' - -os: 'Visual Studio 2015' -clone_folder: '%AV_BF_SOURCE%' -clone_depth: 5 -platform: x64 - -init: - - git config --global core.autocrlf input - - if [%build%] == [ant] appveyor-retry cinst -y ant --version %ant_version% - - refreshenv - - 'if [%java%] == [1.8] set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0"' - - 'if [%java%] == [11] set "JAVA_HOME=C:\Program Files\Java\jdk11"' - - PATH=%JAVA_HOME%\bin;%PATH% - - 'if [%build%] == [maven] set "MAVEN_OPTS=-Dmaven.repo.local=%AV_BF_M2%"' - - 'if [%build%] == [ant] set "ANT_OPTS=-Dmaven.repo.local=%AV_BF_M2%"' - -build_script: - - tools\test-build %build%