From 8866b064a3d70b674e9a8cfae3b3e3875e45157f Mon Sep 17 00:00:00 2001 From: xuty Date: Thu, 7 Nov 2024 18:07:20 +0800 Subject: [PATCH] Add build-windows.yml --- .github/workflows/build-windows.yml | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build-windows.yml diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 0000000..ec6efe7 --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,48 @@ +on: + workflow_dispatch: + inputs: + skip_release: + description: "Skip release related steps? (true/false)" + required: true + default: "false" + +env: + version: m126-6bfb13368b + +jobs: + windows: + runs-on: windows-2019 + strategy: + matrix: + build_type: [Debug, Release] + machine: ["x64", "arm64"] + fail-fast: false + steps: + - run: git config --global core.autocrlf input + - uses: actions/checkout@v2 + - uses: actions/setup-python@v5 + with: + python-version: "3.9" + - shell: bash + run: python3 script/check_release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --target windows --machine ${{ matrix.machine }} + if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: microsoft/setup-msbuild@v1 + - uses: ilammy/msvc-dev-cmd@v1 + - shell: bash + run: python3 script/checkout.py --version ${{ env.version }} + - shell: bash + run: python3 script/build.py --build-type ${{ matrix.build_type }} --target windows --machine ${{ matrix.machine }} + - shell: bash + run: python3 script/archive.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --target windows --machine ${{ matrix.machine }} + - uses: actions/upload-artifact@v3 + if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }} + with: + name: Skia-${{ env.version }}-windows-${{ matrix.build_type }}-${{ matrix.machine }}.zip + path: "*.zip" + - shell: bash + run: python3 script/release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --target windows --machine ${{ matrix.machine }} + if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}