Skip to content

Commit

Permalink
add Docker build to release
Browse files Browse the repository at this point in the history
  • Loading branch information
mriffle committed Sep 8, 2023
1 parent 278ddc7 commit a55cfd0
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 20 deletions.
71 changes: 51 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,61 @@ on:

env:
EXECUTABLE_JAR: "cometTPP2LimelightXML.jar"
DOCKER_REPO: "mriffle/comet-tpp-to-limelight"

jobs:

dockerhub:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew shadowJar
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.DOCKER_REPO }}:latest, ${{ env.DOCKER_REPO }}:${{ steps.get_version.outputs.VERSION }}

release:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew shadowJar
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/${{ env.EXECUTABLE_JAR }}
asset_name: ${{ env.EXECUTABLE_JAR }}
tag: ${{ github.ref }}
overwrite: true
body: ""
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew shadowJar
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/${{ env.EXECUTABLE_JAR }}
asset_name: ${{ env.EXECUTABLE_JAR }}
tag: ${{ github.ref }}
overwrite: true
body: ""
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM amazoncorretto:11.0.17

ADD build/libs/cometTPP2LimelightXML.jar /usr/local/bin/cometTPP2LimelightXML.jar
ADD entrypoint.sh /usr/local/bin/entrypoint.sh
ADD cometTPP2LimelightXML /usr/local/bin/cometTPP2LimelightXML

RUN chmod 755 /usr/local/bin/entrypoint.sh && chmod 755 /usr/local/bin/cometTPP2LimelightXML
RUN yum update -y && yum install -y procps

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD []
18 changes: 18 additions & 0 deletions cometTPP2LimelightXML
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

## Runs cometPercolator2LimelightXML.jar to convert Comet to Limelight XML

# Works when run through a sym link:
path_of_script="$(dirname "$(readlink -f "$0")")"

# Jar File to run
jarFileToRun=cometTPP2LimelightXML.jar

# Java JVM parameters
default_params='-Xmx16192m '
jvm_parameters=${CONVERTER_JAVA_PARAMS:-$default_params}

# "$@" is all command line arguments

java ${jvm_parameters} -Drun_dir=`pwd` -jar ${path_of_script}/${jarFileToRun} \
"$@"
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -e

exec "$@"

0 comments on commit a55cfd0

Please sign in to comment.