Disable parts of build. #38
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: Aikau | |
on: | |
push: | |
branches: | |
- develop | |
- 'support/**' | |
- 'fix/**' | |
- '**/APPS-**' | |
- 'release/**' | |
pull_request: | |
branches: | |
- master | |
- 'support/**' | |
workflow_dispatch: | |
inputs: | |
commitMessage: | |
description: Enter the Commit Message | |
required: true | |
env: | |
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }} | |
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} | |
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
GIT_EMAIL: ${{ secrets.BOT_GITHUB_EMAIL }} | |
GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} | |
GIT_PASSWORD: ${{ secrets.BOT_GITHUB_TOKEN }} | |
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} | |
BRANCH_NAME: ${{ github.ref_name }} | |
jobs: | |
Build: | |
if: ${{ ( startsWith(github.ref_name, 'support/') || github.ref_name == 'develop' || startsWith(github.ref_name, 'SP/') || contains(github.ref_name, 'APPS') ) && | |
github.event_name != 'pull_request' && | |
github.event.repository.fork==false }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: adopt | |
java-version: 17 | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: Setup maven | |
shell: bash | |
run: | | |
[ -d ${HOME}/.m2/ ] || mkdir -p ${HOME}/.m2/ | |
cp -v _ci/settings.xml ${HOME}/.m2/ || cp -v _ci/.travis.settings.xml ${HOME}/.m2/settings.xml | |
- name: Cache the Maven packages to speed up build | |
uses: actions/cache@v1 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: "Starting Source Clear Script" | |
run: bash _ci/source_clear.sh | |
Build_and_test: | |
runs-on: ubuntu-latest | |
needs: Build | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: "Set up Java" | |
uses: actions/setup-java@v3 | |
with: | |
distribution: adopt | |
java-version: 17 | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: Setup maven | |
shell: bash | |
run: | | |
[ -d ${HOME}/.m2/ ] || mkdir -p ${HOME}/.m2/ | |
cp -v _ci/settings.xml ${HOME}/.m2/ || cp -v _ci/.travis.settings.xml ${HOME}/.m2/settings.xml | |
- name: Cache the Maven packages to speed up build | |
uses: actions/cache@v1 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: "Run Test" | |
run: | | |
mvn install -DskipTests=true -B -V | |
mvn test | |
Push_To_Nexus: | |
if: ${{ ( startsWith(github.ref_name, 'support/') || startsWith(github.ref_name, 'release/') ) && | |
github.event_name != 'pull_request' && inputs.commitMessage != '[no-release]' && | |
github.event.repository.fork==false }} | |
runs-on: ubuntu-latest | |
needs: Build_and_test | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
- name: "Set up Java" | |
uses: actions/setup-java@v3 | |
with: | |
distribution: adopt | |
java-version: 17 | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: "Setup maven" | |
shell: bash | |
run: | | |
[ -d ${HOME}/.m2/ ] || mkdir -p ${HOME}/.m2/ | |
cp -v _ci/settings.xml ${HOME}/.m2/ || cp -v _ci/.travis.settings.xml ${HOME}/.m2/settings.xml | |
- name: "Cache the Maven packages to speed up build" | |
uses: actions/cache@v1 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: "Build" | |
run: mvn install -DskipTests=true -B -V | |
- name: Get branch name | |
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
with: | |
username: ${{ env.GIT_USERNAME }} | |
email: ${{ env.GIT_EMAIL }} | |
global: true | |
- name: "Push to Nexus" | |
run: | | |
git checkout -B "${BRANCH_NAME}" | |
git config user.email "${GIT_EMAIL}" | |
git config user.name "${GIT_USERNAME}" | |
mvn --batch-mode -q -DscmCommentPrefix="[maven-release-plugin][skip ci] " -Dusername="${GIT_USERNAME}" -Dpassword="${GIT_PASSWORD}" -DskipTests -Darguments=-DskipTests release:clean release:prepare release:perform |