Skip to content

Commit 3105cf4

Browse files
committed
update
1 parent 8ab54fc commit 3105cf4

1 file changed

Lines changed: 16 additions & 20 deletions

File tree

.github/workflows/dev_package_and_upload.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,8 @@ jobs:
7070
- name: Install UPX on Linux
7171
if: ${{ runner.os == 'Linux' && steps.cache-upx.outputs.cache-hit != 'true' }}
7272
run: |
73-
case "${{ runner.arch }}" in
74-
amd64)
75-
UPX_ARCH=x86_64
76-
;;
77-
arm64)
78-
UPX_ARCH=aarch64
79-
;;
80-
esac
81-
82-
UPX_VERSION=${{ env.UPXVERSION }}
83-
UPX_URL="https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-linux-${UPX_ARCH}.tar.xz"
8473
74+
UPX_URL="https://github.com/upx/upx/releases/download/v${{ env.UPXVERSION }}/upx-${{ env.UPXVERSION }}-${{ runner.arch == 'X64' && 'amd64' || 'arm64' }}_linux.tar.xz"
8575
curl -L "$UPX_URL" -o upx.tar.xz
8676
tar -xf upx.tar.xz -C ./upx --strip-components=1
8777
chmod +x ./upx/upx
@@ -107,19 +97,25 @@ jobs:
10797
run: |
10898
./upx/upx --version
10999
shell: bash
110-
111-
- name: get pip cache dir
112-
id: pip-cache-dir
113-
run: echo "pip-cache-dir=$(pip cache dir)" >> $env:GITHUB_OUTPUT
114100

101+
- name: get pip cache dir on Windows
102+
if: ${{ runner.os == 'Windows' }}
103+
id: pip-cache-dir-window
104+
run: echo "pip-cache-dir=$(pip cache dir)" >> $env:GITHUB_OUTPUT
105+
106+
- name: get pip cache dir on Linux
107+
if: ${{ runner.os == 'Linux' }}
108+
id: pip-cache-dir-linux
109+
run: echo "pip-cache-dir=$(pip cache dir)" >> $GITHUB_OUTPUT
110+
115111
- name: pip cache
116112
uses: actions/cache@v4
117113
with:
118-
path: ${{ steps.pip-cache-dir.outputs.pip-cache-dir }} # pip缓存路径
119-
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ hashFiles('package/nuitka_build.py') }}
114+
path: ${{ runner.os == 'Windows' && steps.pip-cache-dir-window.outputs.pip-cache-dir || steps.pip-cache-dir-window.outputs.pip-cache-dir }}
115+
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ github.event.inputs.test && hashFiles(github.event.inputs.config_path) || hashFiles('package/nuitka_build.py') }}
120116
restore-keys: |
121-
${{ runner.os }}-${{ runner.arch }}-pip- # 后备恢复键(当精确键不存在时,使用最近的缓存)
122-
117+
${{ runner.os }}-${{ runner.arch }}-pip-
118+
123119

124120
- name: Install dependencies
125121
run: |
@@ -144,7 +140,7 @@ jobs:
144140
uses: actions/cache@v4
145141
with:
146142
path: ${{ env.NUITKA_CACHE_DIR }}
147-
key: nuitka-${{ runner.os }}-${{ runner.arch }}-python-${{ env.PYTHON_VERSION }}-nuitka-${{ hashFiles('package/nuitka_build.py') }}
143+
key: nuitka-${{ runner.os }}-${{ runner.arch }}-python-${{ env.PYTHON_VERSION }}-nuitka-${{ github.event.inputs.test && hashFiles(github.event.inputs.config_path) || hashFiles('package/nuitka_build.py') }}
148144
restore-keys: |
149145
nuitka-${{ runner.os }}-${{ runner.arch }}-python-${{ env.PYTHON_VERSION }}-
150146
nuitka-${{ runner.os }}-${{ runner.arch }}-

0 commit comments

Comments
 (0)