Skip to content

Apply automatic changes #221

Apply automatic changes

Apply automatic changes #221

Workflow file for this run

---
name: Bump tomcat versions
on:
push:
branches-ignore:
- dependabot/**
paths:
- .github/workflows/bumpVersions.yml
- updatecli.d/**
- get-checksum.sh
workflow_dispatch:
schedule:
- cron: '0 6 * * MON'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
updatecli:
name: Tomcat ${{ matrix.tomcat_major }} version bump
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- tomcat_major: 10
tcnative_source_pattern: 2
apr_source_pattern: 1
- tomcat_major: 9
tcnative_source_pattern: 2
apr_source_pattern: 1
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Required to trigger the main workflow once this workflow creates a PR
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Install updatecli
uses: Alfresco/alfresco-build-tools/.github/actions/setup-updatecli@v8.31.0
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@abcbd5d83bbe1a69c8da087467fcd132ca0c7a27
- name: Install htmlq
run: |
brew install htmlq
- name: Set required environment variables
run: |
echo "TOMCAT_MAJOR=${{ matrix.tomcat_major }}" >> $GITHUB_ENV
echo "TCNATIVE_SOURCE_PATTERN=${{ matrix.tcnative_source_pattern }}" >> $GITHUB_ENV
echo "APR_SOURCE_PATTERN=${{ matrix.apr_source_pattern }}" >> $GITHUB_ENV
- name: Run updatecli
run: |
updatecli apply
- name: Set new tomcat version as env var
run: |
echo "TOMCAT_VERSION=$(jq -r '.tomcat_version' tomcat${{ matrix.tomcat_major }}.json)" >> $GITHUB_ENV
- name: Set target branch
run: |
echo "TARGET_BRANCH=bump-tomcat-${{ env.TOMCAT_VERSION }}" >> $GITHUB_ENV
- id: auto-commit-action
name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
with:
branch: ${{ env.TARGET_BRANCH }}
push_options: '--force'
commit_user_name: ${{ vars.BOT_GITHUB_USERNAME }}
commit_user_email: ${{ vars.BOT_GITHUB_EMAIL }}
- name: Autocreate PR
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: |
PR_EXISTS=$(gh pr list --head ${{ env.TARGET_BRANCH }} --json url --jq 'length')
if [ "$PR_EXISTS" -eq 0 ]; then
gh pr create --head ${{ env.TARGET_BRANCH }} --title "Bump tomcat to ${{ env.TOMCAT_VERSION }}" --body "Freshly served thanks to updatecli and GitHub Actions"
fi
env:
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}