diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml new file mode 100644 index 00000000..d423f8dd --- /dev/null +++ b/.github/workflows/test-and-build.yml @@ -0,0 +1,37 @@ +name: Test and publish Maven package + +on: [push, pull_request] + +jobs: + test: + 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: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build with Maven + run: mvn clean package -Dmaven.javadoc.skip=true -B -V + - name: Run integration tests + run: mvn failsafe:integration-test && mvn failsafe:verify + publish: + needs: test + runs-on: ubuntu-latest + # Run only for tagged commits + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Publish package + run: mvn --batch-mode deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cf565ac2..00000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -services: - - docker - -language: java -jdk: - - openjdk8 - -addons: - apt: - packages: - - libxml-xpath-perl - -cache: - directories: - - $HOME/.m2 - -install: true - -script: - - mvn clean package -Dmaven.javadoc.skip=true -B -V - - mvn failsafe:integration-test - - mvn failsafe:verify - - ls -la target/ - -deploy: - - provider: script - script: bash -c './prepare-bintray.sh' - skip_cleanup: true - on: - branch: master - - provider: bintray - file: "./travis-bintray-deploy.json" - user: "${BINTRAY_USER}" - key: "${BINTRAY_KEY}" - skip_cleanup: true - on: - branch: master diff --git a/pom.xml b/pom.xml index 1ddeb4b4..96c0db08 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 fi.hsl transitdata-common - 1.3.20 + 1.3.21 jar Common utilities for Transitdata projects @@ -10,7 +10,7 @@ 1.8 1.8 2.3.1 - 1.9.0 + 1.15.2 @@ -45,6 +45,14 @@ + + + github + GitHub HSLdevcom Apache Maven Packages + https://maven.pkg.github.com/HSLdevcom/transitdata-common + + + com.google.protobuf @@ -307,7 +315,5 @@ - - diff --git a/prepare-bintray.sh b/prepare-bintray.sh deleted file mode 100755 index 3b24f40d..00000000 --- a/prepare-bintray.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -POM_VERSION=$(xpath -q -e '/project/version/text()' pom.xml) -echo "Version from pom.xml $POM_VERSION" - -newRev="travis-bintray-deploy.json" -rm -f $newRev - -sed "s/POM_VERSION/$POM_VERSION/g" travis-bintray-deploy.template.json > $newRev - -echo "Bintray deploy json:" -cat $newRev diff --git a/src/integration-test/java/fi/hsl/common/pulsar/MockContainers.java b/src/integration-test/java/fi/hsl/common/pulsar/MockContainers.java index 1d45322b..f8dd9cef 100644 --- a/src/integration-test/java/fi/hsl/common/pulsar/MockContainers.java +++ b/src/integration-test/java/fi/hsl/common/pulsar/MockContainers.java @@ -21,7 +21,7 @@ public class MockContainers { private MockContainers() {} public static GenericContainer newRedisContainer() { - return new GenericContainer("redis:3.0.2") + return new GenericContainer("redis:5.0.6") .withExposedPorts(6379); } diff --git a/travis-bintray-deploy.template.json b/travis-bintray-deploy.template.json deleted file mode 100644 index c28f9396..00000000 --- a/travis-bintray-deploy.template.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "package": { - "name": "transitdata-common", - "repo": "maven", - "subject": "hsldevcom", - "vcs_url": "https://github.com/HSLdevcom/transitdata-common", - "licenses": [ - "EUPL-1.2" - ] - }, - "version": { - "name": "POM_VERSION" - }, - "files": [ - { - "includePattern": "target/(.*\.jar)", - "excludePattern": "target/(.*\jar-with-dependencies.jar)", - "uploadPattern": "fi/hsl/transitdata-common/POM_VERSION/$1" - }, - { - "includePattern": "target/(.*\.pom)", - "excludePattern": "target/maven-archiver/.*", - "uploadPattern": "fi/hsl/transitdata-common/POM_VERSION/$1" - } - ] -}