Skip to content

Commit

Permalink
Attempt at improving the build & release pipelines (#108)
Browse files Browse the repository at this point in the history
* Attempt at improving the build & release pipelines to use preferred Java versions per Druid version

* yamllint

* Update the workflow to hardcode the java version

* shellcheck
  • Loading branch information
lfrancke authored Sep 18, 2024
1 parent aafb574 commit 2438a1e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@ jobs:
strategy:
matrix:
profile:
- druid-26.0.0
- druid-30.0.0

- {druid: druid-26.0.0, java: '11'}
- {druid: druid-30.0.0, java: '17'}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 17

- name: Set up JDK
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0
with:
java-version: '17'
java-version: ${{ matrix.profile.java }}
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B verify -P${{ matrix.profile }}
run: mvn -B verify -P${{ matrix.profile.druid }}

- name: Update dependency graph
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: advanced-security/maven-dependency-submission-action@4f64ddab9d742a4806eeb588d238e4c311a8397d # v4.1.1
27 changes: 22 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ on:
workflow_dispatch:
inputs:
druid-version:
description: 'Druid version to build the authorizer for. This requires an existing profile with the same name.'
description: 'Select the Druid version to build the authorizer for.'
required: true
type: choice
options:
- druid-26.0.0
- druid-30.0.0
stackable-version:
description: 'The stackable "patch" version to use for this release (starting at 0 and counting up, e.g. "0")'
description: 'The stackable "patch" version to use for this release (e.g., "0").'
required: true
next-stackable-version:
description: 'The next stackable version to use, this updates the POM (without the "-SNAPSHOT"). If stackable-version is 0 then set this to 1 etc.'
Expand All @@ -19,21 +23,34 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set Java Version
id: set_java_version
run: |
if [ "${{ github.event.inputs.druid-version }}" = "druid-26.0.0" ]; then
echo "JAVA_VERSION=11" >> "$GITHUB_ENV"
elif [ "${{ github.event.inputs.druid-version }}" = "druid-30.0.0" ]; then
echo "JAVA_VERSION=17" >> "$GITHUB_ENV"
else
echo "JAVA_VERSION=unknown" >> "$GITHUB_ENV"
fi
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Release
uses: qcastel/github-actions-maven-release@681756a2798ce7fc477d2db2fefcdec6670f6fed # tag=v1.12.41
env:
# This action uses a Dockerfile with Java preinstalled
# See here for the list of supported JDKs: https://github.com/qcastel/docker-maven-release/blob/master/Dockerfile
JAVA_HOME: /usr/lib/jvm/java-17-openjdk/
JAVA_HOME: /usr/lib/jvm/java-${{ env.JAVA_VERSION }}-openjdk/
with:
git-release-bot-name: "stacky-mcstackface"
git-release-bot-email: "info@stackable.tech"
maven-args: "clean install -P druid-${{ github.event.inputs.druid-version }}"
maven-args: "clean install -P ${{ github.event.inputs.druid-version }}"
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
maven-release-version-number: ${{ github.event.inputs.druid-version }}-stackable${{ github.event.inputs.stackable-version }}
maven-development-version-number: ${{ github.event.inputs.druid-version }}-stackable${{ github.event.inputs.next-stackable-version}}-SNAPSHOT
maven-development-version-number: ${{ github.event.inputs.druid-version }}-stackable${{ github.event.inputs.next-stackable-version }}-SNAPSHOT
release-branch-name: "main"

- name: Release to GitHub
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
with:
Expand Down

0 comments on commit 2438a1e

Please sign in to comment.