Add helm chart description to README (#31) #25
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
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: | | |
if [ ${{ github.ref }} == 'refs/heads/main' ]; then | |
VERSION=$(./gradlew :lib:properties -q | grep "version:" | awk '{print $2}') | |
elif [[ ${{ github.ref }} =~ ^refs\/tags\/v ]]; then | |
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/v##g") | |
else | |
echo 'This job might not be triggered by neither the vM.m.p tag pushing nor main branch merging' | |
exit 1 | |
fi | |
echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Upload the package to Maven Central Repository | |
run: | | |
echo "${{ secrets.SIGNING_SECRET_KEY_RING }}" | base64 -d > /tmp/secring.gpg | |
./gradlew publish \ | |
-PprojVersion="${{ steps.version.outputs.version }}" \ | |
-Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \ | |
-P'signing.password'="${{ secrets.SIGNING_PASSWORD }}" \ | |
-Psigning.secretKeyRingFile='/tmp/secring.gpg' \ | |
-PossrhUsername="${{ secrets.OSSRH_USERNAMAE }}" \ | |
-PossrhPassword="${{ secrets.OSSRH_PASSWORD }}" | |
- name: Build the shadow Jar | |
run: ./gradlew shadowJar | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- 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-for-kubernetes:${{ steps.version.outputs.version }} | |
platforms: linux/amd64,linux/arm64/v8 |