Skip to content

rebase-integration-branch #200

rebase-integration-branch

rebase-integration-branch #200

name: rebase-integration-branch
on:
workflow_dispatch:
schedule:
# Run every day at 2AM
- cron: '0 2 * * *'
env:
LANG: en_US.UTF-8
JAVA_VERSION: 17
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: write
issues: write
jobs:
rebase-integration-branch:
if: github.repository == 'quarkiverse/quarkus-cxf'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dependency-short-name: 'quarkus'
dependency-stream: 'main'
dependency-branch: 'main'
issue-id: 1287
base-branch: 'main'
dependency-git-repo-url: https://github.com/quarkusio/quarkus.git
- dependency-short-name: 'cxf'
dependency-stream: 'main'
dependency-branch: 'main'
issue-id: 1767
base-branch: 'main'
dependency-git-repo-url: https://github.com/apache/cxf.git
- dependency-short-name: 'quarkus'
dependency-stream: '3.20'
dependency-branch: '3.20'
issue-id: 1771
base-branch: '3.20'
dependency-git-repo-url: https://github.com/quarkusio/quarkus.git
- dependency-short-name: 'cxf'
dependency-stream: '4.1'
dependency-branch: 'main'
issue-id: 1772
base-branch: '3.20'
dependency-git-repo-url: https://github.com/apache/cxf.git
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up JDK ${{ inputs.java-version }}
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- name: rebase-integration-branch
uses: ./.github/actions/rebase-integration-branch
id: rebase-integration-branch
with:
dependency-git-repo-url: ${{ matrix.dependency-git-repo-url }}
dependency-short-name: ${{ matrix.dependency-short-name }}
dependency-stream: ${{ matrix.dependency-stream }}
dependency-branch: ${{ matrix.dependency-branch }}
base-branch: ${{ matrix.base-branch }}
issue-id: ${{ matrix.issue-id }}
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Show steps.rebase-integration-branch.outputs.exit-status
shell: bash
run: |
echo "steps.rebase-integration-branch.outputs.exit-status: ${{ steps.rebase-integration-branch.outputs.exit-status }}"
- name: build-and-run-jvm-tests
uses: ./.github/actions/build-and-run-jvm-tests
with:
run-native-tests: 'true'
upload-local-maven-repo-archive: 'false'
token: ${{ secrets.GITHUB_TOKEN }}
- name: git push origin ${{ matrix.dependency-short-name }}-${{ matrix.dependency-stream }} -f
shell: bash
run: |
lastCommitMessage="$(git log -1 --pretty=%B)"
echo "Comparing last commit message '$lastCommitMessage' with '${{ steps.rebase-integration-branch.outputs.upgrade-message }}'"
if [[ "$lastCommitMessage" == "${{ steps.rebase-integration-branch.outputs.upgrade-message }}" ]]; then
echo "Removing last commit '$lastCommitMessage'"
git reset --hard HEAD~1
else
echo "Not removing the last commit because its message is not '${{ steps.rebase-integration-branch.outputs.upgrade-message }}' but '$lastCommitMessage'"
fi
git push origin ${{ matrix.dependency-short-name }}-${{ matrix.dependency-stream }} -f
- name: Reopen issue https://github.com/${{ github.repository }}/issues/${{ matrix.issue-id }}
if: ${{ steps.rebase-integration-branch.outputs.exit-status == 'success' && failure() }}
shell: bash
run: |
oldState=$(gh issue view ${{ matrix.issue-id }} --json state -q .state -R ${{ github.repository }})
echo "oldState = $oldState"
msg="❌ Build with ${{ matrix.dependency-short-name }} ${{ steps.rebase-integration-branch.outputs.dependency-commit }} failed in ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
if [[ "$oldState" == "OPEN" ]] ; then
gh issue comment \
--repo ${{ github.repository }} \
--body "$msg" \
${{ matrix.issue-id }}
else
gh issue reopen \
--repo ${{ github.repository }} \
--comment "$msg" \
${{ matrix.issue-id }}
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Close issue https://github.com/${{ github.repository }}/issues/${{ matrix.issue-id }}
if: ${{ success() }}
shell: bash
run: |
oldState=$(gh issue view ${{ matrix.issue-id }} --json state -q .state -R ${{ github.repository }})
echo "oldState = $oldState"
msg="✅ Build with ${{ matrix.dependency-short-name }} ${{ steps.rebase-integration-branch.outputs.dependency-commit }} succeeded in ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
if [[ "$oldState" != "CLOSED" ]] ; then
gh issue close \
--repo ${{ github.repository }} \
--comment "$msg" \
${{ matrix.issue-id }}
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}