Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release workflow #13

Merged
merged 12 commits into from
Aug 28, 2023
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Build Docker image
run: ./gradlew docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Push Docker image to GitHub Container Registry
run: docker push ghcr.io/scalar-labs/scalar-admin-k8s:${{ env.version }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push the image
uses: docker/build-push-action@v4
with:
context: ./cli
push: true
tags: ghcr.io/scalar-labs/scalar-admin-k8s:${{ env.version }}
choplin marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ subprojects {
mockitoVersion = '4.11.0'
jacksonVersion = '2.15.2'
spotbugsVersion = '4.7.3'
dockerPluginVersion = '0.34.0'
shadowJarPluginVersion = '7.1.2'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/scalar-labs/jre8:1.1.14

COPY scalar-admin-k8s-*.jar /app.jar
COPY build/libs/scalar-admin-k8s-cli*.jar /app.jar

RUN groupadd -r --gid 201 scalar && \
useradd -r --uid 201 -g scalar scalar
Expand Down
9 changes: 1 addition & 8 deletions cli/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'com.github.johnrengelman.shadow' version "${shadowJarPluginVersion}"
id 'com.palantir.docker' version "${dockerPluginVersion}"
id 'com.github.johnrengelman.shadow' version '8.1.1'
}

dependencies {
Expand All @@ -19,9 +18,3 @@ shadowJar {
// this is to merge gRPC service files into the shadow jar
mergeServiceFiles()
}

docker {
dependsOn shadowJar
name "ghcr.io/scalar-labs/scalar-admin-k8s:${project.version}"
files tasks.shadowJar.outputs
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is changed because my local Gradle was upgraded to 8.3 and I regenerate the Gradle wrapper to upgrade the wrapper from 7.6.2 to 8.1.1. Can ignore this diff.

distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 6 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is changed because my local Gradle was upgraded to 8.3 and I regenerate the Gradle wrapper to upgrade the wrapper from 7.6.2 to 8.1.1. Can ignore this diff.

# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down