From 5154db305f296044a205663994b774a50a10c7bd Mon Sep 17 00:00:00 2001 From: Andrei Alexeyev Date: Sat, 30 Sep 2023 14:13:08 +0200 Subject: [PATCH] ci: add some settings for release workflow --- .github/workflows/release.yml | 51 +++++++++++++++++++++++++++----- scripts/macos_setup_universal.sh | 24 +++++++-------- 2 files changed, 55 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e7672fb00..a296f2adba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,12 +10,35 @@ on: inputs: custom-ref: required: false - description: "Input git-ref to build as a test release" + description: "Build release from git-ref:" + developer: + default: false + type: boolean + description: "Developer build" + linux-x64: + default: true + type: boolean + macos-x64-arm64: + default: true + type: boolean + windows-x64: + default: true + type: boolean + windows-x86: + default: true + type: boolean + emscripten: + default: true + type: boolean + switch: + default: true + type: boolean schedule: # run every Wednesday at 8AM EST - cron: '0 8 * * 3' env: + DEFAULT_REF: 'master' MESON_VERSION: '0.63.3' EM_VERSION: '3.1.44' EM_CACHE_FOLDER: 'emsdk' @@ -25,8 +48,10 @@ env: jobs: linux-release-build-x64: name: "Linux (x64/Source)" + if: ${{ github.event.inputs.linux-x64 == 'true' }} runs-on: ubuntu-20.04 steps: + - name: Install Python uses: actions/setup-python@v4 with: @@ -70,7 +95,7 @@ jobs: with: submodules: 'recursive' fetch-depth: 0 - ref: ${{ github.event.inputs.custom-ref }} + ref: ${{ github.event.inputs.custom-ref || env.GITHUB_REF || env.DEFAULT_REF }} - name: Configure run: > @@ -83,6 +108,7 @@ jobs: --native-file misc/ci/forcefallback.ini --native-file misc/ci/linux-x86_64-build-release.ini --prefix=$(pwd)/build-release + -Ddeveloper=${{ github.event.inputs.developer }} - name: Set Package Version run: | @@ -140,6 +166,7 @@ jobs: macos-release-build-universal: name: macOS (Universal) + if: ${{ github.event.inputs.macos-x64-arm64 == 'true' }} runs-on: macos-12 steps: - name: Install Tools @@ -167,14 +194,14 @@ jobs: with: submodules: 'recursive' fetch-depth: 0 - ref: ${{ github.event.inputs.custom-ref }} + ref: ${{ github.event.inputs.custom-ref || env.GITHUB_REF || env.DEFAULT_REF }} - name: Configure run: | git config --global --add safe.directory $(pwd) git fetch --force --tags $(pwd)/scripts/macos_configure_env.sh $(pwd)/build-release/ $(pwd) - $(pwd)/scripts/macos_setup_universal.sh + $(pwd)/scripts/macos_setup_universal.sh -Ddeveloper=${{ github.event.inputs.developer }} shell: bash - name: Set Package Version @@ -217,6 +244,7 @@ jobs: windows-release-build-x64: name: Windows (x64) + if: ${{ github.event.inputs.windows-x64 == 'true' }} runs-on: ubuntu-latest container: taiseiproject/windows-toolkit:20230929 steps: @@ -231,7 +259,7 @@ jobs: with: submodules: 'recursive' fetch-depth: 0 - ref: ${{ github.event.inputs.custom-ref }} + ref: ${{ github.event.inputs.custom-ref || env.GITHUB_REF || env.DEFAULT_REF }} - name: Checkout ANGLE DLLs uses: actions/checkout@v3 @@ -252,6 +280,7 @@ jobs: --cross-file misc/ci/forcefallback.ini --cross-file misc/ci/windows-llvm_mingw-x86_64-build-release.ini --prefix=$(pwd)/build-release + -Ddeveloper=${{ github.event.inputs.developer }} - name: Set Package Version run: | @@ -299,6 +328,7 @@ jobs: windows-release-build-x86: name: Windows (x86) + if: ${{ github.event.inputs.windows-x86 == 'true' }} runs-on: ubuntu-latest container: taiseiproject/windows-toolkit:20230929 steps: @@ -313,7 +343,7 @@ jobs: with: submodules: 'recursive' fetch-depth: 0 - ref: ${{ github.event.inputs.custom-ref }} + ref: ${{ github.event.inputs.custom-ref || env.GITHUB_REF || env.DEFAULT_REF }} - name: Checkout ANGLE DLLs uses: actions/checkout@v3 @@ -334,6 +364,7 @@ jobs: --cross-file misc/ci/forcefallback.ini --cross-file misc/ci/windows-llvm_mingw-x86-build-release.ini --prefix=$(pwd)/build-release + -Ddeveloper=${{ github.event.inputs.developer }} - name: Set Package Version run: | @@ -381,6 +412,7 @@ jobs: emscripten-release-build: name: Emscripten + if: ${{ github.event.inputs.emscripten == 'true' }} runs-on: ubuntu-20.04 steps: - name: Install Python @@ -415,7 +447,7 @@ jobs: with: submodules: 'recursive' fetch-depth: 0 - ref: ${{ github.event.inputs.custom-ref }} + ref: ${{ github.event.inputs.custom-ref || env.GITHUB_REF || env.DEFAULT_REF }} - name: Fetch Cached Emscripten SDK id: emsdk-cache @@ -455,6 +487,7 @@ jobs: --cross-file misc/ci/emscripten-build.ini --cross-file misc/ci/emscripten-ephemeral-ci.ini --prefix=$(pwd)/build-release + -Ddeveloper=${{ github.event.inputs.developer }} - name: Set Package Version run: | @@ -491,6 +524,7 @@ jobs: switch-release-build: name: Switch (ARM64) + if: ${{ github.event.inputs.switch == 'true' }} runs-on: ubuntu-20.04 container: taiseiproject/switch-toolkit:20221226 steps: @@ -505,7 +539,7 @@ jobs: with: submodules: 'recursive' fetch-depth: 0 - ref: ${{ github.event.inputs.custom-ref }} + ref: ${{ github.event.inputs.custom-ref || env.GITHUB_REF || env.DEFAULT_REF }} - name: Configure run: > @@ -520,6 +554,7 @@ jobs: --cross-file misc/ci/switch-options.ini --cross-file misc/ci/switch-crossfile-ci.ini --prefix=$(pwd)/build-release + -Ddeveloper=${{ github.event.inputs.developer }} - name: Set Package Version run: | diff --git a/scripts/macos_setup_universal.sh b/scripts/macos_setup_universal.sh index bc732ad44f..65b5dffe9e 100755 --- a/scripts/macos_setup_universal.sh +++ b/scripts/macos_setup_universal.sh @@ -6,16 +6,16 @@ source $(pwd)/.mac_env mkdir -p $MAC_BUILD_DIR/compiled $MESON_BUILD_ROOT_MACOS_COMBINED meson setup \ - --native-file $TAISEI_ROOT/misc/ci/common-options.ini \ - --native-file $TAISEI_ROOT/misc/ci/forcefallback.ini \ - --native-file $TAISEI_ROOT/misc/ci/macos-x86_64-build-release.ini \ - --prefix $MESON_BUILD_ROOT_MACOS_X64_COMPILED \ - $MESON_BUILD_ROOT_MACOS_X64 \ - $TAISEI_ROOT + --native-file $TAISEI_ROOT/misc/ci/common-options.ini \ + --native-file $TAISEI_ROOT/misc/ci/forcefallback.ini \ + --native-file $TAISEI_ROOT/misc/ci/macos-x86_64-build-release.ini \ + --prefix $MESON_BUILD_ROOT_MACOS_X64_COMPILED \ + $MESON_BUILD_ROOT_MACOS_X64 \ + $TAISEI_ROOT "$@" meson setup \ - --cross-file $TAISEI_ROOT/misc/ci/common-options.ini \ - --cross-file $TAISEI_ROOT/misc/ci/forcefallback.ini \ - --cross-file $TAISEI_ROOT/misc/ci/macos-aarch64-build-release.ini \ - --prefix $MESON_BUILD_ROOT_MACOS_AARCH64_COMPILED \ - $MESON_BUILD_ROOT_MACOS_AARCH64 \ - $TAISEI_ROOT + --cross-file $TAISEI_ROOT/misc/ci/common-options.ini \ + --cross-file $TAISEI_ROOT/misc/ci/forcefallback.ini \ + --cross-file $TAISEI_ROOT/misc/ci/macos-aarch64-build-release.ini \ + --prefix $MESON_BUILD_ROOT_MACOS_AARCH64_COMPILED \ + $MESON_BUILD_ROOT_MACOS_AARCH64 \ + $TAISEI_ROOT "$@"