From 00890b6e31dc4f8e38e4a542430a70a360ca6229 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Thu, 29 Dec 2022 14:56:07 +0800 Subject: [PATCH] feat: use pwsh if possible --- .github/workflows/nuitka.yml | 48 +++++++++++++----------------------- action_build.ps1 | 1 - 2 files changed, 17 insertions(+), 32 deletions(-) delete mode 100644 action_build.ps1 diff --git a/.github/workflows/nuitka.yml b/.github/workflows/nuitka.yml index 9a30729..830978e 100644 --- a/.github/workflows/nuitka.yml +++ b/.github/workflows/nuitka.yml @@ -29,15 +29,8 @@ jobs: uses: actions/checkout@v3 # 获取短 sha - - name: Get short commit sha (bash) - if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }} - id: get_short_sha_bash - run: | - short_sha=$(echo ${GITHUB_SHA} | cut -c1-7) - echo "short_sha=$short_sha" >> $GITHUB_OUTPUT - - name: Get short commit sha (powershell) - if: runner.os == 'Windows' - id: get_short_sha_powershell + - name: Get short commit sha + id: get_short_sha shell: pwsh run: | $short_sha = echo $`{GITHUB_SHA`} @@ -67,19 +60,23 @@ jobs: if: runner.os == 'Windows' shell: pwsh run: | - ./action_build.ps1 -# $arg = "--standalone --assume-yes-for-download " -# $arg += "--msvc=latest --clang --lto=no --output-dir=build " -# $arg += "--nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet " -# $arg += "--include-data-dir=./libs/pyglet=./pyglet " -# $arg += "--include-data-dir=./libs/fonts=./libs/fonts " -# $arg += "--include-data-dir=./textures=./textures " -# $arg += "--include-data-dir=./configs=./configs " -# python -m nuitka $arg DR.py + $arg = @() + $arg += @("--standalone") + $arg += @("--assume-yes-for-download") + $arg += @("--msvc=latest") + $arg += @("--clang") + $arg += @("--lto=no") + $arg += @("--output-dir=build") + $arg += @("--nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet") + $arg += @("--include-data-dir=./libs/pyglet=./pyglet") + $arg += @("--include-data-dir=./libs/fonts=./libs/fonts") + $arg += @("--include-data-dir=./textures=./textures") + $arg += @("--include-data-dir=./configs=./configs") + python -m nuitka $arg DR.py - name: Build on MacOS / Linux if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }} - shell: pwsh + shell: bash run: | arg="--standalone --assume-yes-for-download --output-dir=build " arg+="--clang --lto=no " @@ -93,21 +90,10 @@ jobs: - name: after build run: python after_compile.py - - # Uploads artifact - - name: Upload Artifact (bash) - if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }} - uses: actions/upload-artifact@v3 - with: - name: ${{ runner.os }} Build.${{ github.run_number}}+${{ steps.get_short_sha_bash.outputs.short_sha }} - path: | - build/*.zip - # Uploads artifact - name: Upload Artifact (powershell) - if: runner.os == 'Windows' uses: actions/upload-artifact@v3 with: - name: ${{ runner.os }} Build.${{ github.run_number}}+${{ steps.get_short_sha_powershell.outputs.short_sha }} + name: ${{ runner.os }} Build.${{ github.run_number}}+${{ steps.get_short_sha.outputs.short_sha }} path: | build/*.zip \ No newline at end of file diff --git a/action_build.ps1 b/action_build.ps1 deleted file mode 100644 index 1fbb2d3..0000000 --- a/action_build.ps1 +++ /dev/null @@ -1 +0,0 @@ -python -m nuitka --standalone --assume-yes-for-download --msvc=latest --clang --lto=no --output-dir=build --nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet --include-data-dir=./libs/pyglet=./pyglet --include-data-dir=./libs/fonts=./libs/fonts --include-data-dir=./textures=./textures --include-data-dir=./configs=./configs DR.py \ No newline at end of file