From 93a8248d1af6324828e41b4875f4db343993440e Mon Sep 17 00:00:00 2001 From: sinspired Date: Tue, 15 Oct 2024 22:36:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E9=80=89DNS=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=EF=BC=8C=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0hosts?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_release.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index d0c2b44..60bb808 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -16,21 +16,21 @@ jobs: runs-on: ${{ matrix.os }} permissions: contents: write - + steps: - uses: actions/checkout@v3 - + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: python-version: '3.11' - + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install pyinstaller - + - name: Build executables (Linux) if: matrix.os == 'ubuntu-latest' run: | @@ -38,7 +38,8 @@ jobs: pyinstaller --onefile "$script" mv "dist/${script%.py}" "dist/${script%.py}-Linux-x64" done - + zip -j "cnNetTool-Linux-x64.zip" dist/*-Linux-x64 + - name: Build executables (Windows) if: matrix.os == 'windows-latest' run: | @@ -48,14 +49,17 @@ jobs: $exeName = $script -replace '\.py$', '' Move-Item "dist\$exeName.exe" "dist\$exeName-Windows-x64.exe" } + Compress-Archive -Path dist\*-Windows-x64.exe -DestinationPath "cnNetTool-Windows-x64.zip" shell: pwsh - + - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: ${{ matrix.platform }}-executables - path: dist/* - + path: | + cnNetTool-Linux-x64.zip + cnNetTool-Windows-x64.zip + create-release: needs: build-and-release runs-on: ubuntu-latest @@ -72,7 +76,7 @@ jobs: delete_release: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -83,11 +87,12 @@ jobs: release_name: Release ${{ github.ref }} draft: false prerelease: false - + - name: Upload Release Assets uses: softprops/action-gh-release@v1 with: files: | - *-executables/* + cnNetTool-Linux-x64.zip + cnNetTool-Windows-x64.zip env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}