From 4137752c49caf35421229c1f6aee36699291609a Mon Sep 17 00:00:00 2001 From: Lkhsss Date: Sun, 17 Nov 2024 09:18:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=87=AA=E5=8A=A8=E6=9E=84?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93bcfa8..a3a369e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,8 @@ on: push: branches: - main + tags: + - "v*.*.*" workflow_dispatch: {} jobs: build: @@ -23,7 +25,7 @@ jobs: target: x86_64-apple-darwin archive-name: ncmmiao-macos.tar.gz - build: windows - os: windows-2019 + os: windows-latest rust: stable-x86_64-msvc target: x86_64-pc-windows-msvc archive-name: ncmmiao-windows.7z @@ -31,7 +33,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4.2.2 - name: Install Rust uses: actions-rs/toolchain@v1 @@ -39,6 +41,7 @@ jobs: toolchain: ${{ matrix.rust }} profile: minimal override: true + components: rustfmt, clippy target: ${{ matrix.target }} - name: Build binary @@ -66,8 +69,9 @@ jobs: # tar -czf "${{ matrix.archive-name }}" LICENSE README.md ncmmiao tar -czf "${{ matrix.archive-name }}" README.md ncmmiao fi - - name: Upload archive - uses: actions/upload-artifact@v1 + - name: Release archive + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') with: - name: ${{ matrix.archive-name }} - path: archive/${{ matrix.archive-name }} + # name: ${{ matrix.archive-name }} + files: archive/${{ matrix.archive-name }}