[PRODDEL-8532] Release 2.2.0 #232
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: alfresco Extension Inspector Build Workflow | |
on: | |
push: | |
branches: | |
- master | |
- 'fix/**' | |
- 'support/**' | |
- 'feature/**' | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
inputs: | |
commitMessage: | |
description: Enter the Commit Message | |
required: true | |
env: | |
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }} | |
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} | |
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} | |
GITHUB_EVENT: ${{ github.event_name }} | |
VERSION: 2.0.0 | |
jobs: | |
pmd_scan: | |
name: "PMD Scan" | |
runs-on: ubuntu-latest | |
if: > | |
github.event_name == 'pull_request' && | |
!contains(github.event.head_commit.message, '[skip pmd]') && | |
!contains(github.event.head_commit.message, '[skip tests]') && | |
!contains(github.event.head_commit.message, '[force]') | |
steps: | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- uses: Alfresco/[email protected] | |
with: | |
fail-on-new-issues: "false" | |
create-github-annotations: "false" | |
tests: | |
runs-on: ubuntu-latest | |
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') || inputs.commitMessage == '[skip tests]' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Setup maven | |
shell: bash | |
run: | | |
[ -d ${HOME}/.m2/ ] || mkdir -p ${HOME}/.m2/ | |
cp -v _ci/settings.xml ${HOME}/.m2/ || cp -v .travis.settings.xml ${HOME}/.m2/settings.xml | |
- name: Cache the Maven packages to speed up build | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Run Source Code | |
run: bash _ci/source_clear.sh | |
continue-on-error: true | |
- name: Run Unit Test | |
run: bash _ci/unit_tests.sh | |
release: | |
name: "Release" | |
runs-on: ubuntu-latest | |
needs: tests | |
if: ${{ ( startsWith(github.ref_name, 'support/') || github.ref_name == 'master' ) && | |
contains(github.event.head_commit.message, '[release]') || inputs.commitMessage == '[release]' }} | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: "Configure AWS credentials" | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_S3_STAGING_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.AWS_S3_STAGING_SECRET_KEY }} | |
aws-region: eu-west-1 | |
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
- name: Get branch name | |
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
- name: Setup maven | |
shell: bash | |
run: | | |
[ -d ${HOME}/.m2/ ] || mkdir -p ${HOME}/.m2/ | |
cp -v _ci/settings.xml ${HOME}/.m2/ || cp -v .travis.settings.xml ${HOME}/.m2/settings.xml | |
- name: Cache the Maven packages to speed up build | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: "release to nexus" | |
env: | |
GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} | |
GIT_EMAIL: ${{ secrets.BOT_GITHUB_EMAIL }} | |
GIT_PASSWORD: ${{ secrets.BOT_GITHUB_TOKEN }} | |
BUILD_NUMBER: ${{ github.run_number }} | |
run: bash _ci/release.sh | |
- name: "prepare_staging_deploy" | |
run: bash _ci/prepare_staging_deploy.sh | |
- name: "Deploy to S3 Staging Bucket" | |
run : aws s3 cp --recursive ./deploy_dir s3://alfresco-artefacts-staging/AlfrescoExtensionInspector/${VERSION} | |
publish: | |
name: "Copy-to-S3-Release-Bucket" | |
runs-on: ubuntu-latest | |
needs: release | |
if: ${{ ( startsWith(github.ref_name, 'support/') || github.ref_name == 'master' ) && | |
contains(github.event.head_commit.message, '[publish]') || inputs.commitMessage == '[publish]' && | |
github.event_name != 'pull_request'}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_S3_RELEASE_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_S3_RELEASE_SECRET_ACCESS_KEY }} | |
aws-region: eu-west-1 | |
- name: "copy to release bucket" | |
run : bash _ci/copy_to_release_bucket.sh |