release #365
Workflow file for this run
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: release | |
# Run workflow on commits to the `main` branch | |
on: | |
workflow_dispatch: | |
inputs: | |
snapshot-build: | |
description: 'Snapshot build?' | |
type: boolean | |
required: true | |
default: false | |
release-tag: | |
description: 'Release Tag (only if not snapshot)' | |
required: false | |
default: 'services_XXX_apps_XXX' | |
apps: | |
description: 'Release apps?' | |
type: boolean | |
required: true | |
default: true | |
apps-new-version: | |
description: 'New apps version (only if apps)' | |
required: false | |
services: | |
description: 'Release services?' | |
type: boolean | |
required: true | |
default: true | |
services-new-version: | |
description: 'New services version (only if services) - SNAPSHOT will be added to the version' | |
required: false | |
maven: | |
description: 'Release Maven?' | |
type: boolean | |
required: true | |
default: true | |
docs: | |
description: 'Release docs?' | |
type: boolean | |
required: true | |
default: true | |
jobs: | |
release-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
registry-url: 'https://registry.npmjs.org' | |
cache-dependency-path: "./digiwf-apps/package-lock.json" | |
- name: Prepare mvnw | |
run: chmod +x ./mvnw | |
- name: Set apps release version env variable | |
if: github.event.inputs.snapshot-build == 'false' | |
working-directory: ./digiwf-apps | |
run: | | |
echo "APPS_RELEASE_VERSION=$(grep -m1 version lerna.json | awk -F: '{ print $2 }' | sed 's/[", ]//g')" >> $GITHUB_ENV | |
- name: Set apps release version env variable for SNAPSHOT release | |
if: github.event.inputs.snapshot-build == 'true' | |
working-directory: ./digiwf-apps | |
run: | | |
echo "APPS_RELEASE_VERSION=$(grep -m1 version lerna.json | awk -F: '{ print $2 }' | sed 's/[", ]//g')-SNAPSHOT" >> $GITHUB_ENV | |
- name: Remove snapshot from services | |
if: github.event.inputs.snapshot-build == 'false' | |
run: ./mvnw versions:set --batch-mode -DremoveSnapshot -DprocessAllModules | |
- name: Set services release version env variable | |
run: echo "SERVICES_RELEASE_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
outputs: | |
apps-release-version: ${{ env.APPS_RELEASE_VERSION }} | |
services-release-version: ${{ env.SERVICES_RELEASE_VERSION }} | |
release-apps: | |
if: github.event.inputs.apps == 'true' | |
needs: release-version | |
uses: ./.github/workflows/workflow-build-apps.yaml | |
with: | |
publish-packages: ${{ github.event.inputs.snapshot-build == 'false' }} | |
build-images: true | |
release-version: ${{ needs.release-version.outputs.apps-release-version }} | |
secrets: inherit | |
release-services: | |
if: github.event.inputs.services == 'true' | |
needs: release-version | |
uses: ./.github/workflows/workflow-build-services.yaml | |
with: | |
snapshot-release: ${{ github.event.inputs.snapshot-build == 'true' }} | |
release-version: ${{ needs.release-version.outputs.services-release-version }} | |
maven-release: ${{ github.event.inputs.maven == 'true' }} | |
build-images: true | |
secrets: inherit | |
release-docs: | |
if: github.event.inputs.docs == 'true' | |
needs: release-version | |
uses: ./.github/workflows/workflow-build-docs.yaml | |
with: | |
publish: ${{ github.event.inputs.snapshot-build == 'false' }} | |
secrets: inherit | |
github-release: | |
if: github.event.inputs.snapshot-build == 'false' && always() && !contains(needs.*.result, 'failure') | |
needs: [ release-apps, release-services, release-docs ] | |
uses: ./.github/workflows/workflow-github-release.yaml | |
with: | |
release-tag: ${{ github.event.inputs.release-tag }} | |
secrets: inherit | |
bump-versions: | |
if: github.event.inputs.snapshot-build == 'false' && always() && !contains(needs.*.result, 'failure') | |
needs: github-release | |
uses: ./.github/workflows/workflow-bump-version.yaml | |
with: | |
apps-new-version: ${{ github.event.inputs.apps-new-version }} | |
services-new-version: ${{ github.event.inputs.services-new-version }} | |
bump-services-version: ${{ github.event.inputs.services == 'true' }} | |
bump-apps-version: ${{ github.event.inputs.apps == 'true' }} | |
secrets: inherit |