From 877810b9594c68c656801f12278342e845bfa6ba Mon Sep 17 00:00:00 2001 From: clearloop Date: Fri, 17 May 2024 06:11:50 +0800 Subject: [PATCH] ci(label): test E3-forcerelease --- .github/workflows/label.yml | 50 +++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 99c5c237edc..68233884c8d 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -17,12 +17,37 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Detect Profiles + id: detect-profiles + run: | + profiles='{"name": "debug", "flags": ""}' + linuxJobs='"linux (debug)", "win-cross (debug)"' + osxJobs='"macos-x86 (debug)", "macos-aarch64 (debug)"' + winJobs='"win-native (debug)"' + + if [ "${{ contains(github.event.pull_request.labels.*.name, 'E3-forcerelease') }}" = "true" ]; + then + profiles+=', {"name": "release", "flags": "--release"}' + linuxJobs+=', "linux (release)", "win-cross (release)"' + osxJobs+=', "macos-x86 (release)", "macos-aarch64 (release)"' + winJobs+=', "win-native (release)"' + fi + + profiles="[${profiles}]" + linuxJobs="[${linuxJobs}]" + osxJobs="[${osxJobs}]" + winJobs="[${winJobs}]" + echo "profiles=${profiles}" >> "$GITHUB_OUTPUT" + echo "linuxJobs=${linuxJobs}" >> "$GITHUB_OUTPUT" + echo "osxJobs=${osxJobs}" >> "$GITHUB_OUTPUT" + echo "winJobs=${winJobs}" >> "$GITHUB_OUTPUT" + # - name: Fork Linux checks # if: >- # github.event.label.name == 'A0-pleasereview' # || github.event.label.name == 'A4-insubstantial' # || github.event.label.name == 'A2-mergeoncegreen' - # uses: gear-tech/fork-action@main + # uses: gear-tech/fork-action@cl/profiles # with: # token: ${{ secrets.GITHUB_TOKEN }} # head_sha: ${{ github.event.pull_request.head.sha }} @@ -31,14 +56,22 @@ jobs: # workflow_id: ".github/workflows/build.yml" # prefix: "build" # needs: '["dynamic-profiles"]' - # jobs: '["linux (debug)", "win-cross (debug)"]' + # jobs: ${{ steps.detect-profiles.outputs.linuxJobs }} # inputs: - # '{ "title": "${{ github.event.pull_request.title }}", "number": "${{ - # github.event.number }}" }' + # '{ + # "title": "${{ github.event.pull_request.title }}", + # "number": "${{ github.event.number }}", + # "release": "${{ + # contains(github.event.pull_request.labels.*.name, 'E3-forcerelease') + # }}", + # "production": "${{ + # contains(github.event.pull_request.labels.*.name, 'E4-forceproduction') + # }}" + # }' # # - name: Fork OSX checks # if: github.event.label.name == 'E2-forcemacos' - # uses: gear-tech/fork-action@main + # uses: gear-tech/fork-action@cl/profiles # with: # token: ${{ secrets.GITHUB_TOKEN }} # head_sha: ${{ github.event.pull_request.head.sha }} @@ -46,11 +79,11 @@ jobs: # repo: "gear-tech/gear" # workflow_id: ".github/workflows/build-macos.yml" # prefix: "build" - # jobs: '["macos-x86 (debug)", "macos-aarch64 (debug)"]' + # jobs: ${{ steps.detect-profiles.outputs.osxJobs }} - name: Fork Win checks # if: github.event.label.name == 'E1-forcenatwin' - uses: gear-tech/fork-action@main + uses: gear-tech/fork-action@cl/profiles with: token: ${{ secrets.GITHUB_TOKEN }} head_sha: ${{ github.event.pull_request.head.sha }} @@ -58,4 +91,5 @@ jobs: repo: "gear-tech/gear" workflow_id: ".github/workflows/build-win-native.yml" prefix: "build" - jobs: '["win-native (debug)"]' + jobs: ${{ steps.detect-profiles.outputs.winJobs }} + profiles: ${{ steps.detect-profiles.outputs.profiles }}