Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis -> GH actions #24

Merged
merged 17 commits into from
Feb 22, 2021
39 changes: 0 additions & 39 deletions .appveyor.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: 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 Ant
run: ./tools/test-build ant
66 changes: 66 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Builds using maven
# Pass the arguments you wish to run to maven_commands variable, default command will be mvn install
---
name: Maven

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:
maven_commands: install # default is install
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build
run: mvn ${{ env.maven_commands }}
deploy:
if: contains('refs/heads/develop', github.ref)
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Retrieve version
id: get_version
run: |
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'
fi
- name: Set up Repository
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: ${{ steps.set_server.outputs.server }}
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 }}

18 changes: 0 additions & 18 deletions .travis.settings.xml

This file was deleted.

47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Bio-Formats

[![Build Status](https://travis-ci.org/openmicroscopy/bioformats.png)](http://travis-ci.org/openmicroscopy/bioformats)
[![Actions Status](https://github.com/IDR/bioformats/workflows/Ant/badge.svg)](https://github.com/IDR/bioformats/actions)
[![Actions Status](https://github.com/IDR/bioformats/workflows/Maven/badge.svg)](https://github.com/IDR/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
Expand Down
5 changes: 4 additions & 1 deletion components/formats-bsd/src/loci/formats/UpgradeChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "0.6.5";

/** Location of the OME continuous integration server. */
Expand All @@ -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";
Expand Down
5 changes: 3 additions & 2 deletions tools/bump_maven_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -18,6 +18,7 @@ def check_version_format(version):
".*<artifactId>pom-bio-formats</artifactId>\n"
".*<version>).*(</version>)")


class Replacer(object):

def __init__(self, old_group="ome", new_group="ome"):
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions tools/source-archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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':
Expand Down