From f13e2aae06f5a5a16347917de211cf0d502e2953 Mon Sep 17 00:00:00 2001 From: Chad Rakoczy Date: Mon, 8 Jan 2024 19:25:47 +0000 Subject: [PATCH] Update workflow to sync from upstream --- .github/actions/fetch-repo/action.yml | 19 ----------- .github/actions/fetch-repo/refresh.sh | 11 ------ .github/actions/merge-repo/action.yml | 19 ----------- .github/actions/merge-repo/merge.sh | 13 ------- .github/workflows/refresh-jdk-dev.yml | 32 ++++++++++++++++++ .github/workflows/refresh-jdk.yml | 45 +++++++++++++------------ .github/workflows/refresh-jdk21-dev.yml | 31 ----------------- 7 files changed, 55 insertions(+), 115 deletions(-) delete mode 100644 .github/actions/fetch-repo/action.yml delete mode 100755 .github/actions/fetch-repo/refresh.sh delete mode 100644 .github/actions/merge-repo/action.yml delete mode 100755 .github/actions/merge-repo/merge.sh create mode 100644 .github/workflows/refresh-jdk-dev.yml delete mode 100644 .github/workflows/refresh-jdk21-dev.yml diff --git a/.github/actions/fetch-repo/action.yml b/.github/actions/fetch-repo/action.yml deleted file mode 100644 index 2bcf33ad5f3..00000000000 --- a/.github/actions/fetch-repo/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Fetch upstream repository' -description: 'Fetch the upstream openjdk repository and update the corresponding branches' - -inputs: - upstream: - description: 'Upstream repository https git url' - required: true - local-branch: - description: 'Local branch tracking the remote upstream' - required: true -outputs: - status: - description: 'Status of the upstream fetch and merge' -runs: - using: "composite" - steps: - - run: $GITHUB_ACTION_PATH/refresh.sh ${{ inputs.upstream }} ${{ inputs.local-branch }} - shell: bash - id: fetch-and-update-repo diff --git a/.github/actions/fetch-repo/refresh.sh b/.github/actions/fetch-repo/refresh.sh deleted file mode 100755 index 8003bf23bb6..00000000000 --- a/.github/actions/fetch-repo/refresh.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -x - -UPSTREAM=$1 -LOCAL_BRANCH=$2 - -REMOTE_NAME=upstream-${LOCAL_BRANCH} -git remote add ${REMOTE_NAME} ${UPSTREAM} -git fetch origin ${LOCAL_BRANCH}:${LOCAL_BRANCH} || exit 1 -git fetch ${REMOTE_NAME} master:${LOCAL_BRANCH} || exit 1 -git push origin ${LOCAL_BRANCH} diff --git a/.github/actions/merge-repo/action.yml b/.github/actions/merge-repo/action.yml deleted file mode 100644 index 2cc86508092..00000000000 --- a/.github/actions/merge-repo/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Merge Upstream branch' -description: 'Merge Upstream branch to Develop branch.' - -inputs: - upstream: - description: 'Upstream branch in repository' - required: true - merge-branch: - description: 'Merge branch in local repository' - required: true -outputs: - status: - description: 'Status of the upstream fetch and merge' -runs: - using: "composite" - steps: - - run: $GITHUB_ACTION_PATH/merge.sh ${{ inputs.upstream }} ${{ inputs.merge-branch }} - shell: bash - id: merge-upstream-to-develop diff --git a/.github/actions/merge-repo/merge.sh b/.github/actions/merge-repo/merge.sh deleted file mode 100755 index 4a4902001c1..00000000000 --- a/.github/actions/merge-repo/merge.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -x - -UPSTREAM_BRANCH=$1 -MERGE_BRANCH=$2 - -git config user.email "no-reply@amazon.com" -git config user.name "corretto-github-robot" - -git checkout ${MERGE_BRANCH} -git merge -m "Merge ${UPSTREAM_BRANCH}" ${UPSTREAM_BRANCH} || exit 1 - -git push origin ${MERGE_BRANCH} diff --git a/.github/workflows/refresh-jdk-dev.yml b/.github/workflows/refresh-jdk-dev.yml new file mode 100644 index 00000000000..4caab7b6cc2 --- /dev/null +++ b/.github/workflows/refresh-jdk-dev.yml @@ -0,0 +1,32 @@ +name: "Refresh jdk from Upstream-dev" +on: + schedule: + - cron: '0 9 * * *' + workflow_dispatch: +env: + UPSTREAM_REMOTE: https://github.com/openjdk/jdk21u-dev + LOCAL_BRANCH: nightly +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/jdk21u-dev:master to the corretto-21:nightly" + run: | + git fetch $UPSTREAM_REMOTE master || exit 1 + git merge -m "Merge upstream-jdk21u-dev" 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 diff --git a/.github/workflows/refresh-jdk.yml b/.github/workflows/refresh-jdk.yml index d7977c2ae68..f1b812d32ef 100644 --- a/.github/workflows/refresh-jdk.yml +++ b/.github/workflows/refresh-jdk.yml @@ -1,11 +1,13 @@ -name: "Refresh jdk21 from Upstream" +name: "Refresh jdk from Upstream" on: schedule: - - cron: '0 7 * * *' + - cron: '0 8 * * *' workflow_dispatch: - +env: + UPSTREAM_REMOTE: https://github.com/openjdk/jdk21u + LOCAL_BRANCH: develop jobs: - refresh-jdk21: + refresh-jdk: runs-on: ubuntu-latest name: "Update Corretto-21" if: github.repository_owner == 'corretto' @@ -14,23 +16,22 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - name: "Fetch Corretto-21 upstream" - uses: ./.github/actions/fetch-repo - with: - upstream: 'https://github.com/openjdk/jdk21u.git' - local-branch: 'upstream' - - name: "Merge Corretto-21" - uses: ./.github/actions/merge-repo - with: - upstream: 'upstream' - merge-branch: 'develop' + 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" - uses: ./.github/actions/update-version - with: - upstream: 'upstream' - version-branch: 'develop' + 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" - uses: ./.github/actions/merge-repo - with: - upstream: 'develop' - merge-branch: 'nightly' + shell: bash + run: | + git checkout nightly + git merge origin/$LOCAL_BRANCH diff --git a/.github/workflows/refresh-jdk21-dev.yml b/.github/workflows/refresh-jdk21-dev.yml deleted file mode 100644 index 81292a399f7..00000000000 --- a/.github/workflows/refresh-jdk21-dev.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Refresh jdk21u-dev from Upstream" -on: - schedule: - - cron: '0 8 * * *' - workflow_dispatch: - -jobs: - refresh-jdk21-dev: - runs-on: ubuntu-latest - name: "Update Corretto-21 nightly" - if: github.repository_owner == 'corretto' - steps: - - name: "Checkout code" - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: "Fetch Corretto-21" - uses: ./.github/actions/fetch-repo - with: - upstream: 'https://github.com/openjdk/jdk21u-dev.git' - local-branch: 'upstream-jdk21u-dev' - - name: "Merge Corretto-21" - uses: ./.github/actions/merge-repo - with: - upstream: 'upstream-jdk21u-dev' - merge-branch: 'nightly' - - name: "Update Corretto version" - uses: ./.github/actions/update-version - with: - upstream: 'upstream-jdk21u-dev' - version-branch: 'nightly'