Skip to content

feat: JSON Masking #2103

feat: JSON Masking

feat: JSON Masking #2103

Workflow file for this run

name: Main
on:
push:
branches:
- master
- dev
tags:
- '*'
pull_request:
branches:
- master
- dev
jobs:
check:
name: Check
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- uses: actions/checkout@v4
# Caches
- name: Gradle cache
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}"
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle wrapper cache
uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: "${{ runner.os }}-wrapper-${{ hashFiles('**/*.gradle') }}"
restore-keys: |
${{ runner.os }}-wrapper-
- name: Npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: "${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ runner.os }}-node-
- name: Node cache
uses: actions/cache@v4
with:
path: node
key: "${{ runner.os }}-node-${{ hashFiles('**/*.gradle') }}"
restore-keys: |
${{ runner.os }}-node-
# JDK
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
# Gradle check
- name: Build with Gradle
run: |
./gradlew classes testClasses --parallel --no-daemon
./gradlew check --no-daemon
# report test
- name: Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure()
with:
report_paths: '**/build/test-results/**/TEST-*.xml'
# Shadow Jar, Tar and Zip
- name: Build jars and distribution archives
if: success()
run: ./gradlew shadowJar distTar distZip --no-daemon
# Upload artifacts
- name: Copy jar to docker
run: |
cp build/libs/akhq-*-all.jar docker/app/akhq.jar
mkdir -p build/dist/
find build/distributions/akhq-*.tar -type f -exec cp "{}" build/dist/ ";"
find build/distributions/akhq-*.zip -type f -exec cp "{}" build/dist/ ";"
- name: Upload jar
uses: actions/upload-artifact@v4
if: success()
with:
name: jar
path: build/libs/
# Release
- name: Changelog
id: changelog
uses: scottbrenner/generate-changelog-action@master
if: startsWith(github.ref, 'refs/tags/')
env:
REPO: ${{ github.repository }}
with:
package-dir: 'client/package.json'
# GitHub Release
- name: Create GitHub release
uses: marvinpinto/action-automatic-releases@latest
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
build/libs/*-all.jar
build/dist/akhq-*.tar
build/dist/akhq-*.zip
# Docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
- name: Login to DockerHub
uses: docker/login-action@v3
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GHCR
uses: docker/login-action@v3
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
with:
images: |
tchiotludo/akhq
ghcr.io/${{ github.repository }}
tags: |
# set latest tag for master branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
- name: Publish to registries
uses: docker/build-push-action@v6
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
# Slack
- name: Slack notification
uses: 8398a7/action-slack@v3
if: ${{ always() && env.SLACK_WEBHOOK_URL != 0 }}
with:
status: ${{ job.status }}
username: Github Actions
icon_emoji: ':github-actions:'
channel: 'C03H9CEBGS2'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}