Skip to content

Automation of Rosa Scaling Benchmark (#462) #84

Automation of Rosa Scaling Benchmark (#462)

Automation of Rosa Scaling Benchmark (#462) #84

Workflow file for this run

name: Snapshot Release
on:
push:
branches:
- main
- '*-release'
paths-ignore:
- 'provision/**'
- 'antora/**'
- 'doc/**'
- '.github/workflows/*.yml'
- '!.github/workflows/snapshot.yml'
concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Publish binaries
runs-on: ubuntu-latest
# publishing can only happen on the main repository, not in forks
if: github.repository == 'keycloak/keycloak-benchmark'
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Cache Maven Wrapper
uses: actions/cache@v3
with:
path: |
.mvn/wrapper/maven-wrapper.jar
key: ${{ runner.os }}-maven-wrapper-${{ hashFiles('**/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-maven-wrapper-
- name: Build
run:
mvn clean install
- name: Set version
id: get_version
run: echo VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) >> $GITHUB_OUTPUT
- name: Delete existing release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ( gh release view ${{ steps.get_version.outputs.VERSION }} --repo ${{ github.repository_owner }}/${{ github.event.repository.name }} &> /dev/null ); then
gh release delete ${{ steps.get_version.outputs.VERSION }} --repo ${{ github.repository_owner }}/${{ github.event.repository.name }} --yes
git push --delete origin ${{ steps.get_version.outputs.VERSION }}
fi
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Keycloak Benchmark ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: true
body: |
Latest version built from the `${{ github.ref_name }}` branch.
- name: Publish dataset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dataset/target/keycloak-benchmark-dataset-${{ steps.get_version.outputs.VERSION }}.jar
asset_name: keycloak-benchmark-dataset-${{ steps.get_version.outputs.VERSION }}.jar
asset_content_type: application/gzip
- name: Publish kcb ZIP
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./benchmark/target/keycloak-benchmark-${{ steps.get_version.outputs.VERSION }}.zip
asset_name: keycloak-benchmark-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/gzip
- name: Publish kcb TAR
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./benchmark/target/keycloak-benchmark-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_name: keycloak-benchmark-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_content_type: application/gzip