Skip to content

Commit

Permalink
Move to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vic committed Apr 28, 2020
1 parent e4b1a46 commit 2646438
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 49 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion .mill-version

This file was deleted.

1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
scala 2.12.11
mill 0.6.2
java adopt-openjdk-11+28
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
39 changes: 4 additions & 35 deletions ci
Original file line number Diff line number Diff line change
@@ -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
;;
Expand Down

0 comments on commit 2646438

Please sign in to comment.