672cef89d2
Closes #25116 Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
91 lines
3.1 KiB
YAML
91 lines
3.1 KiB
YAML
name: Build Keycloak
|
|
description: Builds Keycloak providing Maven repository with all artifacts
|
|
|
|
inputs:
|
|
upload-m2-repo:
|
|
description: Upload Maven repository for org.keycloak artifacts
|
|
required: false
|
|
default: "true"
|
|
upload-dist:
|
|
description: Upload distribution
|
|
required: false
|
|
default: "false"
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- id: setup-java
|
|
name: Setup Java
|
|
uses: ./.github/actions/java-setup
|
|
|
|
- id: maven-cache
|
|
name: Maven cache
|
|
uses: ./.github/actions/maven-cache
|
|
with:
|
|
create-cache-if-it-doesnt-exist: true
|
|
|
|
- id: phantomjs-cache
|
|
name: PhantomJS cache
|
|
uses: ./.github/actions/phantomjs-cache
|
|
|
|
- id: frontend-plugin-cache
|
|
name: Frontend Plugin Cache
|
|
uses: ./.github/actions/frontend-plugin-cache
|
|
|
|
# Remove once https://github.com/keycloak/keycloak/issues/19299 is solved
|
|
########################################################################################################
|
|
- id: check-adapter-changes
|
|
if: github.event_name == 'pull_request'
|
|
name: Check changes for WildFly adapters
|
|
shell: bash
|
|
# If there are no changes for WildFly adapters, we use adapters built in the latest nightly build
|
|
run: |
|
|
WF_ADAPTERS_REGEX="^adapters/oidc/wildfly|^adapters/saml/wildfly"
|
|
|
|
git fetch origin --tags --force
|
|
|
|
echo "GIT_WF_ADAPTERS_DIFF=$(git diff origin/main --name-only | egrep -ic -e "$WF_ADAPTERS_REGEX")" >> $GITHUB_ENV
|
|
echo "NIGHTLY_DIFF=$(git diff nightly --name-only | egrep -ic -e "$WF_ADAPTERS_REGEX")" >> $GITHUB_ENV
|
|
|
|
- id: set-maven-profile
|
|
if: ${{ github.event_name != 'pull_request' || env.GIT_WF_ADAPTERS_DIFF != 0 || env.NIGHTLY_DIFF != 0}}
|
|
name: Set profile for building distribution
|
|
shell: bash
|
|
run: |
|
|
echo "MVN_PROFILES=-Pdistribution" >> $GITHUB_ENV
|
|
echo "WildFly adapters will be built in our codebase"
|
|
########################################################################################################
|
|
|
|
- id: build-keycloak
|
|
name: Build Keycloak
|
|
shell: bash
|
|
# By using "dependency:resolve", it will download all dependencies used in later stages for running the tests
|
|
run: |
|
|
./mvnw install dependency:resolve -V -e -DskipTests -DskipExamples ${{ env.MVN_PROFILES}}
|
|
|
|
- id: compress-keycloak-maven-repository
|
|
name: Compress Keycloak Maven artifacts
|
|
if: inputs.upload-m2-repo == 'true'
|
|
shell: bash
|
|
run: |
|
|
tar -C ~/ --use-compress-program zstd -cf m2-keycloak.tzts \
|
|
--exclude '*.tar.gz' \
|
|
.m2/repository/org/keycloak
|
|
|
|
- id: upload-keycloak-maven-repository
|
|
name: Upload Keycloak Maven artifacts
|
|
if: inputs.upload-m2-repo == 'true'
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: m2-keycloak.tzts
|
|
path: m2-keycloak.tzts
|
|
retention-days: 1
|
|
|
|
- id: upload-keycloak-dist
|
|
name: Upload Keycloak dist
|
|
if: inputs.upload-dist == 'true'
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: keycloak-dist
|
|
path: quarkus/dist/target/keycloak*.tar.gz
|
|
retention-days: 1
|