From 2646438c995a744491071fa5407d96dbb5ad292a Mon Sep 17 00:00:00 2001 From: Victor Hugo Borja Date: Tue, 28 Apr 2020 10:51:57 -0500 Subject: [PATCH] Move to github actions --- .github/workflows/workflow.yml | 43 ++++++++++++++++++++++++++++++++++ .mill-version | 1 - .tool-versions | 1 + .travis.yml | 12 ---------- README.md | 2 +- ci | 39 ++++-------------------------- 6 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/workflow.yml delete mode 100644 .mill-version delete mode 100644 .travis.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..3bae5c9 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,43 @@ +name: Main workflow + +on: + push: + paths-ignore: + - "**.md" + pull_request: + paths-ignore: + - "**.md" + schedule: + - cron: "0 0 * * 5" + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Asdf install + uses: asdf-vm/actions/install@v1.0.0 + - name: Test + run: ./ci test + + jitpack-commit: + needs: test + runs-on: ubuntu-latest + steps: + - name: JitPack commit build + run: curl -vSL https://jitpack.io/com/github/$GITHUB_REPOSITORY/$GITHUB_SHA/build.log || true + + jitpack-release: + needs: test + runs-on: ubuntu-latest + if: contains(github.ref, 'tags') + steps: + - name: JitPack release build + run: | + curl -vSL https://jitpack.io/com/github/$GITHUB_REPOSITORY/$(echo "${{github.ref}}" | sed 's#tags/##')/build.log || true diff --git a/.mill-version b/.mill-version deleted file mode 100644 index b1d7abc..0000000 --- a/.mill-version +++ /dev/null @@ -1 +0,0 @@ -0.6.2 \ No newline at end of file diff --git a/.tool-versions b/.tool-versions index 6ed741b..32230df 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,3 @@ scala 2.12.11 +mill 0.6.2 java adopt-openjdk-11+28 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 549c1a4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -sudo: required -services: - - docker -language: minimal -before_install: - - ./ci asdf install -install: - - ./ci install -script: - - ./ci test - - ./ci jitpack release - diff --git a/README.md b/README.md index c2e7581..83bd3dc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # mill-docker [![Jitpack](https://jitpack.io/v/vic/mill-docker.svg)](https://jitpack.io/#vic/mill-docker) -[![Build Status](https://travis-ci.org/vic/mill-docker.svg?branch=master)](https://travis-ci.org/vic/mill-docker) +![Main workflow](https://github.com/vic/mill-docker/workflows/Main%20workflow/badge.svg) A [Mill][mill] module for building minimal [distroless][distroless] docker images from your java applications. diff --git a/ci b/ci index a498895..482f293 100755 --- a/ci +++ b/ci @@ -1,62 +1,31 @@ #!/usr/bin/env bash set -ex -MODULE=docker -JITPACK_URL=https://jitpack.io/com/github/$TRAVIS_REPO_SLUG - mkdir -p $HOME/bin export PATH=$HOME/bin:$PATH -test -f ~/.asdf/asdf.sh && source ~/.asdf/asdf.sh - -whoami -env -which asdf || echo "no asdf" case "$*" in - "") - $0 install - $0 test - ;; - - install) - mill -i $MODULE.publishLocal - ;; - jitpack) - mill -i $MODULE.m2 + mill -i _.m2 mkdir -p ~/.m2 - cp -rv out/$MODULE/m2/dest/ ~/.m2/repository + cp -rv out/*/m2/dest/ ~/.m2/repository ;; - "jitpack build") - curl -NvfL $JITPACK_URL/$TRAVIS_COMMIT/build.log - ;; - - "jitpack release") - if [ ! -z "$TRAVIS_TAG" ]; then - curl -NvfL $JITPACK_URL/$TRAVIS_TAG/build.log - fi - ;; "jitpack deps") # asdf depends on column and asdf-java depends on jq, # however it seems there's no way to install system dependencies on jitpack container. # We just install mill and set a jdk on jitpack.yml echo installing mill via curl - mill_version=$(< .mill-version) + mill_version=$(awk '/mill/ {print $2}' .tool-versions) curl -o $HOME/bin/mill -L https://github.com/lihaoyi/mill/releases/download/$mill_version/$mill_version chmod +x $HOME/bin/mill ;; - "asdf install") - git clone https://github.com/asdf-vm/asdf.git ~/.asdf - source ~/.asdf/asdf.sh - cat .tool-versions | cut -d' ' -f 1 | xargs -IX asdf plugin-add X - asdf install # install all from .tool-versions - ;; test) + mill -i _.publishLocal (cd example; mill -i hello.dockerBuild) docker run -i hello:latest ;;