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 }}