From 1af3250c16add1ef1ff0d7253bac13a0f96548c4 Mon Sep 17 00:00:00 2001 From: Abdoulbari Zakir Date: Mon, 19 Feb 2024 15:32:05 +0100 Subject: [PATCH 1/4] add branch selection --- .github/workflows/new_release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/new_release.yml b/.github/workflows/new_release.yml index 8181160fc4..4189753378 100644 --- a/.github/workflows/new_release.yml +++ b/.github/workflows/new_release.yml @@ -3,6 +3,9 @@ name: Create new release on: workflow_dispatch: inputs: + target_branch: + description: "Target branch or full commit SHA (default develop)" + default: "develop" release_tag: description: "Release tag" required: true @@ -24,11 +27,13 @@ jobs: tag: ${{ github.event.inputs.release_tag }} title: ${{ github.event.inputs.release_name }} tests: ${{ github.event.inputs.run-tests }} + target_branch: ${{ github.event.inputs.target_branch }} run: | gh release create "$tag" \ --repo="$GITHUB_REPOSITORY" \ --title="$title" \ --notes="Run tests: $tests" + --target="$target_branch" From 38acef024be7ffcd4c49ec95655591c1095c75fa Mon Sep 17 00:00:00 2001 From: Abdoulbari Zakir Date: Mon, 19 Feb 2024 15:40:39 +0100 Subject: [PATCH 2/4] fix --- .github/workflows/new_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/new_release.yml b/.github/workflows/new_release.yml index 4189753378..70485d0a08 100644 --- a/.github/workflows/new_release.yml +++ b/.github/workflows/new_release.yml @@ -32,7 +32,7 @@ jobs: gh release create "$tag" \ --repo="$GITHUB_REPOSITORY" \ --title="$title" \ - --notes="Run tests: $tests" + --notes="Run tests: $tests"\ --target="$target_branch" From d47af8b0c4454a8718f16c23481271ab2b98e5f7 Mon Sep 17 00:00:00 2001 From: Abdoulbari Zakir Date: Mon, 19 Feb 2024 15:57:11 +0100 Subject: [PATCH 3/4] checkout specific branch --- .github/workflows/new_release.yml | 5 +++++ .github/workflows/ubuntu.yml | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/new_release.yml b/.github/workflows/new_release.yml index 70485d0a08..c65ca9dc1e 100644 --- a/.github/workflows/new_release.yml +++ b/.github/workflows/new_release.yml @@ -43,6 +43,7 @@ jobs: uses: ./.github/workflows/ubuntu.yml with: run-tests: ${{ inputs.run-tests }} + target_branch: ${{ inputs.target_branch }} windows: name: Release - Windows @@ -50,6 +51,7 @@ jobs: uses: ./.github/workflows/windows-vcpkg.yml with: run-tests: ${{ inputs.run-tests }} + target_branch: ${{ inputs.target_branch }} centos7: name: Release - centos7 @@ -57,6 +59,7 @@ jobs: uses: ./.github/workflows/centos7.yml with: run-tests: ${{ inputs.run-tests }} + target_branch: ${{ inputs.target_branch }} oracle8: name: Release - oracle8 @@ -64,6 +67,7 @@ jobs: uses: ./.github/workflows/oracle8.yml with: run-tests: ${{ inputs.run-tests }} + target_branch: ${{ inputs.target_branch }} user_guide: name: User Guide @@ -71,3 +75,4 @@ jobs: uses: ./.github/workflows/build-userguide.yml with: run-tests: ${{ inputs.run-tests }} + target_branch: ${{ inputs.target_branch }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index aea9bfa099..ce97851457 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -17,6 +17,9 @@ on: run-tests: required: true type: string + target_branch: + required: true + type: string env: GITHUB_TOKEN: ${{ github.token }} @@ -37,7 +40,8 @@ jobs: steps: - uses: actions/checkout@v3 - + with: + ref: ${{ inputs.target_branch}} - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: From 426bc86e21d670c708b30e1bf2cdb1f83ee32c75 Mon Sep 17 00:00:00 2001 From: Abdoulbari Zakir Date: Thu, 22 Feb 2024 11:34:01 +0100 Subject: [PATCH 4/4] split --- .github/workflows/build-userguide.yml | 5 +++++ .github/workflows/centos7.yml | 2 +- .github/workflows/new_release.yml | 3 +-- .github/workflows/oracle8.yml | 2 +- .github/workflows/ubuntu.yml | 4 +++- .github/workflows/windows-vcpkg.yml | 7 +++++++ 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-userguide.yml b/.github/workflows/build-userguide.yml index 0adce086ec..6845e63bb3 100644 --- a/.github/workflows/build-userguide.yml +++ b/.github/workflows/build-userguide.yml @@ -12,6 +12,9 @@ on: run-tests: required: true type: string + target_branch: + required: true + type: string env: IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} @@ -25,6 +28,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + ref: ${{ inputs.target_branch}} - name: Set up Python uses: actions/setup-python@v4 diff --git a/.github/workflows/centos7.yml b/.github/workflows/centos7.yml index 9bdd69dff6..0cb8996c0e 100644 --- a/.github/workflows/centos7.yml +++ b/.github/workflows/centos7.yml @@ -33,7 +33,7 @@ jobs: - name: Checkout run: | - git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b $GITHUB_REF_NAME . + git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${{ github.event.inputs.target_branch }} . - name: Install gcc 10 run: | diff --git a/.github/workflows/new_release.yml b/.github/workflows/new_release.yml index c65ca9dc1e..0d4d815c33 100644 --- a/.github/workflows/new_release.yml +++ b/.github/workflows/new_release.yml @@ -59,7 +59,6 @@ jobs: uses: ./.github/workflows/centos7.yml with: run-tests: ${{ inputs.run-tests }} - target_branch: ${{ inputs.target_branch }} oracle8: name: Release - oracle8 @@ -67,7 +66,7 @@ jobs: uses: ./.github/workflows/oracle8.yml with: run-tests: ${{ inputs.run-tests }} - target_branch: ${{ inputs.target_branch }} + user_guide: name: User Guide diff --git a/.github/workflows/oracle8.yml b/.github/workflows/oracle8.yml index e3c242c1f7..ac840590b4 100644 --- a/.github/workflows/oracle8.yml +++ b/.github/workflows/oracle8.yml @@ -44,7 +44,7 @@ jobs: - name: Checkout run: | - git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b $GITHUB_REF_NAME . + git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${{ github.event.inputs.target_branch }} . - name: Config OR-Tools URL run: | diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ce97851457..a3d808df8e 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -26,6 +26,7 @@ env: IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} RUN_SIMPLE_TESTS: ${{ github.event_name == 'push' || inputs.run-tests == 'true' }} RUN_EXTENDED_TESTS: ${{ github.event_name == 'schedule' || inputs.run-tests == 'true' }} + REF: ${{ inputs.target_branch =='' && github.ref || inputs.target_branch}} jobs: @@ -41,7 +42,8 @@ jobs: steps: - uses: actions/checkout@v3 with: - ref: ${{ inputs.target_branch}} + ref: ${{ env.REF }} + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index 22a58dc680..e202c8c7e1 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -17,12 +17,16 @@ on: run-tests: required: true type: string + target_branch: + required: true + type: string env: GITHUB_TOKEN: ${{ github.token }} IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} RUN_SIMPLE_TESTS: ${{ github.event_name == 'push' || inputs.run-tests == 'true' }} RUN_EXTENDED_TESTS: ${{ github.event_name == 'schedule' || inputs.run-tests == 'true' }} + REF: ${{ inputs.target_branch =='' && github.ref || inputs.target_branch}} jobs: @@ -40,7 +44,10 @@ jobs: runs-on: windows-latest steps: + - uses: actions/checkout@v3 + with: + ref: ${{ env.REF }} - name: Config OR-Tools URL run: |