Skip to content

Commit

Permalink
Common: switch to Github Actions (close #189)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuwy committed Oct 22, 2020
1 parent 30cf99e commit 9d1f5a2
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 81 deletions.
15 changes: 15 additions & 0 deletions .github/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

project=$1
tag=$2

export RDB_LOADER_VERSION=$tag

release-manager \
--config "./.github/release_${project}.yml" \
--check-version \
--make-version \
--make-artifact \
--upload-artifact
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
---
# --- Variables --- #

local:
root_dir : <%= ENV['TRAVIS_BUILD_DIR'] %>

# --- Release Manager Config --- #

# Required: deployment targets
targets:
- type : "awss3"
Expand Down Expand Up @@ -64,7 +57,7 @@ packages:
version : <%= FUNC['sbt_version(.)'] %>

# Required IF '--check-version' is passed: will assert that both versions are the same
build_version : <%= ENV['TRAVIS_BUILD_RELEASE_TAG'] %>
build_version : <%= ENV['RDB_LOADER_VERSION'] %>

# Optional: Build commands
build_commands:
Expand All @@ -76,4 +69,4 @@ packages:
prefix : "snowplow-rdb-loader-"
suffix : ".jar"
binary_paths:
- "target/scala-2.11/snowplow-rdb-loader-{{ packages.0.build_version }}.jar"
- "modules/loader/target/scala-2.11/snowplow-rdb-loader-{{ packages.0.build_version }}.jar"
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
---
# --- Variables --- #

local:
root_dir : <%= ENV['TRAVIS_BUILD_DIR'] %>

# --- Release Manager Config --- #

# Required: deployment targets
targets:
- type : "awss3"
Expand Down Expand Up @@ -61,10 +54,10 @@ packages:
publish : true
override : false
continue_on_conflict : false
version : <%= CMD['sbt "project shredder" version -Dsbt.log.noformat=true | awk "END{print}" | sed -r "s/\[info\]\s(.*)/\1/" | xargs echo -n'] %>
version : <%= FUNC['sbt_version(.)'] %>

# Required IF '--check-version' is passed: will assert that both versions are the same
build_version : <%= ENV['TRAVIS_BUILD_RELEASE_TAG'] %>
build_version : <%= ENV['RDB_LOADER_VERSION'] %>

# Optional: Build commands
build_commands:
Expand All @@ -76,4 +69,4 @@ packages:
prefix : "snowplow-rdb-shredder-"
suffix : ".jar"
binary_paths:
- "shredder/target/scala-2.11/snowplow-rdb-shredder-{{ packages.0.build_version }}.jar"
- "modules/shredder/target/scala-2.11/snowplow-rdb-shredder-{{ packages.0.build_version }}.jar"
File renamed without changes.
4 changes: 2 additions & 2 deletions .travis/start_iglu.sh → .github/start_iglu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ set -e

IGLUCTL_ZIP="igluctl_0.6.0.zip"
IGLUCTL_URI="http://dl.bintray.com/snowplow/snowplow-generic/$IGLUCTL_ZIP"
SCHEMAS_PATH="$TRAVIS_BUILD_DIR/iglu-central/schemas/"
SCHEMAS_PATH="$pwd/iglu-central/schemas/"

git clone https://github.com/snowplow/iglu-central.git

docker run \
-p 8080:8080 \
-v $TRAVIS_BUILD_DIR/.travis:/iglu \
-v $pwd/.github:/iglu \
--rm -d \
snowplow-docker-registry.bintray.io/snowplow/iglu-server:0.6.0-rc16 \
--config /iglu/server.conf
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test

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: Run tests
run: sbt test

deploy:
needs: test
if: startsWith(github.ref, 'refs/tags/')
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: Install release manager
run: pip install --user release-manager==0.4.1
- name: Compare SBT version with git tag
run: .github/check_tag.sh ${GITHUB_REF##*/}
- name: Build and publish Shredder
run: ./github/deploy.sh rdb_shredder ${GITHUB_REF##*/}
- name: Build and publish Loader
run: ./github/deploy.sh rdb_loader ${GITHUB_REF##*/}


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

This file was deleted.

32 changes: 0 additions & 32 deletions .travis/deploy.sh

This file was deleted.

1 change: 1 addition & 0 deletions project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ object BuildSettings {

lazy val assemblySettings = Seq(
jarName,
test in assembly := {},

assembly / assemblyShadeRules := Seq(
ShadeRule.rename(
Expand Down

0 comments on commit 9d1f5a2

Please sign in to comment.