Skip to content

Commit

Permalink
cd(docker-compose): run release workflow from gh ui
Browse files Browse the repository at this point in the history
  • Loading branch information
aabouzaid committed Jan 20, 2025
1 parent ff71996 commit eda24cc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/actions/generate-versions-matrix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ inputs:
versions-path:
description: Versions path to match.
required: true
reset-versions:
description: Retrun empty list of unchanged versions to force run the matrix.
default: "false"

outputs:
# NOTE: To avoid GHA creating skipped matrix jobs, the logic is reversed here.
Expand Down Expand Up @@ -48,6 +51,7 @@ runs:
echo "${camunda_version}" >> ${UNCHANGED_VERSIONS_TMP_FILE};
fi
done
# NOTE: The keys "versions" and "camunda-version" are hard-coded and should be used in the workflow matrix.
# Unchanged.
matrix_unchanged="$(cat ${UNCHANGED_VERSIONS_TMP_FILE} |
Expand All @@ -56,3 +60,10 @@ runs:
# Changed.
should_run="$([[ $(stat --printf="%s" ${CHANGED_VERSIONS_TMP_FILE}) -gt 0 ]] && echo "true" || echo "false")"
echo "should-run=${should_run}" | tee -a $GITHUB_OUTPUT
# Force the downstream workflows run for all versions.
if [[ ${{ inputs.reset-versions }} == 'true' ]]; then
echo "Reset versions..."
echo "matrix-unchanged=[]" | tee -a $GITHUB_OUTPUT
echo "should-run=true" | tee -a $GITHUB_OUTPUT
fi
6 changes: 6 additions & 0 deletions .github/workflows/docker-compose-release-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ jobs:
- **Release strategy:** Camunda Docker Compose release is a rolling release. Hence, it's always 1 artifact per Camunda minor version.
- **Latest update:** $(date)
EOF
- name: Clean up old release
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
gh release list | tee | grep "${{ env.DOCKER_COMPOSE_NAME }}" &&
gh release delete ${{ env.DOCKER_COMPOSE_NAME }} --cleanup-tag
- name: Create git tag
run: |
git tag ${{ env.DOCKER_COMPOSE_NAME }}
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/docker-compose-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ on:
- .github/workflows/docker-compose-release-template.yaml
- .github/workflows/docker-compose-release.yaml
- docker-compose/versions/**
workflow_dispatch:
inputs:
release-all:
description: Release all versions.
default: true
type: boolean

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
Expand All @@ -31,6 +37,7 @@ jobs:
uses: ./.github/actions/generate-versions-matrix
with:
versions-path: "docker-compose/versions/camunda-*"
reset-versions: "${{ inputs.release-all || 'false' }}"
outputs:
should-run: ${{ steps.generate-versions-matrix.outputs.should-run }}
unchanged-versions: ${{ steps.generate-versions-matrix.outputs.unchanged }}
Expand All @@ -41,6 +48,8 @@ jobs:
name: ${{ matrix.versions.name || 'Skipped' }}
strategy:
fail-fast: false
# To release the versions in the same order as presented in the matrix.
max-parallel: 1
matrix:
versions:
- name: Camunda 8.3
Expand Down

0 comments on commit eda24cc

Please sign in to comment.