Refresh jdk from Upstream #1218
This file contains hidden or 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: "Refresh jdk from Upstream" | |
| on: | |
| schedule: | |
| - cron: '0 8 * * *' | |
| workflow_dispatch: | |
| env: | |
| UPSTREAM_REMOTE: https://github.com/openjdk/jdk21u | |
| UPSTREAM_SHENANDOAH: https://github.com/openjdk/shenandoah-jdk21u | |
| LOCAL_BRANCH: develop | |
| LOCAL_SHENANDOAH: generational-shenandoah | |
| permissions: | |
| contents: write | |
| jobs: | |
| refresh-jdk: | |
| runs-on: ubuntu-latest | |
| name: "Update Corretto-21" | |
| if: github.repository_owner == 'corretto' | |
| steps: | |
| - name: "Checkout code" | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ env.LOCAL_BRANCH }} | |
| - name: "Configure the user" | |
| run: | | |
| git config user.email "no-reply@amazon.com" | |
| git config user.name "corretto-github-robot" | |
| - name: "Merge openjdk/jdk:master to the corretto-21:develop" | |
| run: | | |
| git fetch $UPSTREAM_REMOTE master || exit 1 | |
| git merge -m "Merge upstream-jdk" FETCH_HEAD | |
| - name: "Update Corretto version" | |
| shell: bash | |
| run: bash ./.github/scripts/update-version.sh $UPSTREAM_REMOTE | |
| - name: "Push to the corretto-21" | |
| run: git push origin $LOCAL_BRANCH | |
| - name: "Merge Corretto-21 develop to nightly" | |
| shell: bash | |
| run: | | |
| git checkout nightly | |
| if ! git merge --no-ff --no-commit origin/$LOCAL_BRANCH; then | |
| # The only conflict we expect/accept is version.txt | |
| unmerged=$(git diff --name-only --diff-filter=U) | |
| if [ "$unmerged" != "version.txt" ]; then | |
| echo "Unexpected merge conflicts: $unmerged" >&2 | |
| exit 1 | |
| fi | |
| fi | |
| # Always keep nightly's version.txt — whether the merge was clean or conflicted | |
| git checkout HEAD -- version.txt | |
| git add version.txt | |
| git commit -m "Merge $LOCAL_BRANCH into nightly" || echo "Nothing to merge; nightly up to date" | |
| git push origin nightly | |
| - name: "Merge Corretto-21 develop to lilliput" | |
| shell: bash | |
| run: | | |
| git checkout lilliput | |
| git restore --source origin/$LOCAL_BRANCH --staged --worktree -- version.txt | |
| git commit -m "Automerged version.txt from $LOCAL_BRANCH to lilliput" || true | |
| git merge origin/$LOCAL_BRANCH | |
| git push origin lilliput | |
| - name: "Merge Corretto-21 develop to lilliput-2" | |
| shell: bash | |
| run: | | |
| git checkout lilliput-2 | |
| git restore --source origin/$LOCAL_BRANCH --staged --worktree -- version.txt | |
| git commit -m "Automerged version.txt from $LOCAL_BRANCH to lilliput-2" || true | |
| git merge origin/$LOCAL_BRANCH | |
| git push origin lilliput-2 | |
| - name: "Merge openjdk/shenandoah-jdk21u:master to generational-shenandoah" | |
| shell: bash | |
| run: | | |
| git checkout $LOCAL_SHENANDOAH | |
| git fetch $UPSTREAM_SHENANDOAH master || exit 1 | |
| git merge -m "Merge upstream shenandoah" FETCH_HEAD | |
| git push origin $LOCAL_SHENANDOAH | |
| - name: "Merge Corretto-21 develop to generational-shenandoah" | |
| shell: bash | |
| run: | | |
| git checkout $LOCAL_SHENANDOAH | |
| git restore --source origin/$LOCAL_BRANCH --staged --worktree -- version.txt | |
| git commit -m "Automerged version.txt from $LOCAL_BRANCH to $LOCAL_SHENANDOAH" || true | |
| git merge origin/$LOCAL_BRANCH | |
| git push origin $LOCAL_SHENANDOAH |