-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
133 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Publish the Java Package to Maven Central Repository and upload tool to GitHub | ||
|
||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '8' | ||
|
||
- name: Set version | ||
id: version | ||
run: | | ||
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/v##g") | ||
echo "version=${VERSION}" >> $GITHUB_OUTPUT | ||
- name: Upload the package to Maven Central Repository | ||
run: | | ||
echo "${{ secrets.SIGNING_SECRET_KEY_RING }}" | base64 -d > ~/.gradle/secring.gpg | ||
./gradlew publish \ | ||
-Pversion=${{ steps.version.outputs.version }} \ | ||
-Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \ | ||
-P'signing.password'="${{ secrets.SIGNING_PASSWORD }}" \ | ||
-Psigning.secretKeyRingFile="$(echo ~/.gradle/secring.gpg)" \ | ||
-PossrhUsername="${{ secrets.OSSRH_USERNAMAE }}" \ | ||
-PossrhPassword="${{ secrets.OSSRH_PASSWORD }}" | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- name: Build Docker image | ||
run: ./gradlew docker | ||
|
||
- name: Push Docker image to GitHub Container Registry | ||
run: docker push ghcr.io/scalar-labs/scalar-admin-k8s:${{ steps.version.outputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ghcr.io/scalar-labs/jre8:1.1.14 | ||
|
||
COPY scalar-admin-k8s-*.jar /app.jar | ||
|
||
RUN groupadd -r --gid 201 scalar && \ | ||
useradd -r --uid 201 -g scalar scalar | ||
|
||
USER 201 | ||
|
||
ENTRYPOINT ["java", "-jar", "/app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId = 'scalar-admin-k8s' | ||
from components.java | ||
pom { | ||
name = 'Scalar Admin for Kubernetes' | ||
description = 'This library provides a fault-tolerant manner to pause Scalar products in Kubernetes environments and ensure the data is transactionally consistent.' | ||
url = 'https://github.com/scalar-labs/scalar-admin' | ||
licenses { | ||
license { | ||
name = 'Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'hiroyuki' | ||
name = 'Hiroyuki Yamada' | ||
email = '[email protected]' | ||
} | ||
developer { | ||
id = 'supl' | ||
name = 'Plenty Su' | ||
email = '[email protected]' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:https://github.com/scalar-labs/scalar-admin-k8s.git' | ||
developerConnection = 'scm:git:https://github.com/scalar-labs/scalar-admin-k8s.git' | ||
url = 'https://github.com/scalar-labs/scalar-admin-k8s' | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" | ||
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
credentials { | ||
username = "${ossrhUsername}" | ||
password = "${ossrhPassword}" | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications.mavenJava | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters