diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32bbc552..f4625e8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -285,6 +285,63 @@ jobs: token: ${{ steps.app-token.outputs.token }} - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v18.21.0 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v18.21.0 + - name: "Clean-up SNAPSHOT artifacts" + run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" -prune -exec rm -rf {} + + - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v18.21.0 + with: + username: ${{ secrets.BOT_GITHUB_USERNAME }} + email: ${{ secrets.BOT_GITHUB_EMAIL }} + global: true + # Deploys the Maven artifacts, creates the verified release commits and tag. + # The (slow) multi-arch Docker images are pushed by the separate + # "push_docker_images" job below (docker.skip=true here). + - name: "Release" + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + uses: Alfresco/alfresco-build-tools/.github/actions/maven-release-slim@v18.21.0 + env: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + with: + token: ${{ steps.app-token.outputs.token }} + release-version: ${{ env.RELEASE_VERSION }} + development-version: ${{ env.DEVELOPMENT_VERSION }} + maven-args: "-DskipTests -Dmaven.javadoc.skip=true -DadditionalOption=-Xdoclint:none -Ddocker.skip=true" + + push_docker_images: + name: "Push Docker Images (${{ matrix.testName }})" + runs-on: ubuntu-latest + needs: [release] + if: > + !(failure() || cancelled()) && + contains(github.event.head_commit.message, '[release]') && + github.event_name != 'pull_request' && + (github.ref_name == 'master' || startsWith(github.ref_name, 'SP/') || startsWith(github.ref_name, 'HF/')) + strategy: + fail-fast: false + matrix: + include: + - testName: ImageMagick + buildProfile: imagemagick + - testName: LibreOffice + buildProfile: libreoffice + - testName: Transform Misc + buildProfile: misc + - testName: PDF Renderer + buildProfile: pdf-renderer + - testName: Tika + buildProfile: tika + - testName: All in One Transformer + buildProfile: full-build + dockerArgs: "-Ddocker.filter=aio" + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + # The release job tags the release commit (which carries the release + # version in the POMs) with ${{ env.RELEASE_VERSION }}. + ref: refs/tags/${{ env.RELEASE_VERSION }} + - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v18.21.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v18.21.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v18.21.0 - name: Set up QEMU uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0 with: @@ -308,16 +365,13 @@ jobs: sudo service docker restart - name: "Clean-up SNAPSHOT artifacts" run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" -prune -exec rm -rf {} + - - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v18.21.0 - with: - username: ${{ secrets.BOT_GITHUB_USERNAME }} - email: ${{ secrets.BOT_GITHUB_EMAIL }} - global: true - name: "Cache LibreOffice" run: bash _ci/cache_artifacts.sh - - name: "Release" + # Builds the module(s) and pushes the multi-arch Docker image(s). The Maven + # artifacts were already deployed by the "release" job, so the artifact + # deploy is skipped here (maven.deploy.skip=true). + - name: "Build and push docker image" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - uses: Alfresco/alfresco-build-tools/.github/actions/maven-release-slim@v18.21.0 env: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} @@ -325,8 +379,8 @@ jobs: QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - with: - token: ${{ steps.app-token.outputs.token }} - release-version: ${{ env.RELEASE_VERSION }} - development-version: ${{ env.DEVELOPMENT_VERSION }} - maven-args: "-DskipTests -Dmaven.javadoc.skip=true -DadditionalOption=-Xdoclint:none" + run: > + mvn -B -U -ntp clean deploy + -P release,${{ matrix.buildProfile }} + -DskipTests -Dmaven.javadoc.skip=true -DadditionalOption=-Xdoclint:none + -Dmaven.deploy.skip=true ${{ matrix.dockerArgs }} diff --git a/docs/build-and-release.md b/docs/build-and-release.md index 0c03d62e..d6c8115d 100644 --- a/docs/build-and-release.md +++ b/docs/build-and-release.md @@ -6,7 +6,10 @@ The `ci.yml` config file can be found in the `.github/workflows` directory of th ## Stages and Jobs 1. **Build**: Java build with unit and integration tests. -2. **Release**: Release with artifact deployment to Nexus, DockerHub and Quay.io. +2. **Release**: Deploys the Maven artifacts to Nexus and creates the verified release + commits and Git tag. +3. **Push Docker Images**: Builds and pushes the multi-arch T-Engine Docker images to + DockerHub and Quay.io. > The _Release_ stage uses the > [`maven-release-slim`](https://github.com/Alfresco/alfresco-build-tools/tree/master/.github/actions/maven-release-slim) @@ -14,6 +17,12 @@ The `ci.yml` config file can be found in the `.github/workflows` directory of th > **verified (signed) commits and tags**, and deploys artifacts with `mvn deploy` (no > `maven-release-plugin`). The release and next development versions are provided explicitly > (see the _Release process steps_ below), which avoids the SemVer auto-increment issue. +> +> Docker images are **not** built during the _Release_ stage (`-Ddocker.skip=true`). The +> slow multi-arch image build/push is handled by the separate _Push Docker Images_ stage, +> which runs one parallel job per T-Engine. Each job checks out the freshly created release +> tag and pushes the images while skipping the (already completed) Maven artifact deploy +> (`-Dmaven.deploy.skip=true`). ## Branches diff --git a/engines/aio/pom.xml b/engines/aio/pom.xml index fd83d851..1295ed34 100644 --- a/engines/aio/pom.xml +++ b/engines/aio/pom.xml @@ -420,6 +420,7 @@ + aio ${image.name}:${project.version} ${image.registry} @@ -440,6 +441,7 @@ + aio ${image.name}:${project.version}