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%
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 00000000000..3a7759e766f
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,22 @@
+---
+name: Build with Maven and Ant
+
+on: [push, pull_request]
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ java: [1.8, 11]
+ os: [ubuntu-latest, windows-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: Build with Maven
+ run: ./tools/test-build maven
+ - name: Build with Ant
+ run: ./tools/test-build ant
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000000..f6471141a5f
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,46 @@
+---
+name: Build and publish packages
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Build artifacts
+ run: |
+ ./tools/test-build ant
+ ant release
+ ant docs
+ - name: Create and Upload Release Assets
+ run: |
+ set -x
+ assets=()
+ touch SHASUMS
+ touch MD5
+ for asset in ./artifacts/*; do
+ assets+=("-a" "$asset")
+ filename=$(basename -- "$asset")
+ 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:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
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));
}
}
diff --git a/components/formats-bsd/src/loci/formats/UpgradeChecker.java b/components/formats-bsd/src/loci/formats/UpgradeChecker.java
index f487f0820d6..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. */
@@ -85,7 +88,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/latest/artifacts/";
/** Name of the ueber tools JAR. */
public static final String TOOLS = "bioformats_package.jar";
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)
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':