feat: rebuild workflow #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| use_cross: false | |
| archive: sv-linux-x86_64.tar.gz | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| use_cross: true | |
| archive: sv-linux-x86_64-musl.tar.gz | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| use_cross: true | |
| archive: sv-linux-aarch64.tar.gz | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| use_cross: false | |
| archive: sv-macos-x86_64.tar.gz | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| use_cross: false | |
| archive: sv-macos-aarch64.tar.gz | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| use_cross: false | |
| archive: sv-windows-x86_64.zip | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| if: matrix.use_cross == true | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cross | |
| - name: Install OpenSSL (Ubuntu native) | |
| if: matrix.os == 'ubuntu-latest' && matrix.use_cross == false | |
| run: sudo apt-get install -y pkg-config libssl-dev | |
| - name: Build (cross) | |
| if: matrix.use_cross == true | |
| run: cross build --release --target ${{ matrix.target }} | |
| - name: Build (native) | |
| if: matrix.use_cross == false | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Package (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cp target/${{ matrix.target }}/release/sv sv | |
| tar -czf ${{ matrix.archive }} sv | |
| rm sv | |
| - name: Package (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Copy-Item "target\${{ matrix.target }}\release\sv.exe" "sv.exe" | |
| Compress-Archive -Path "sv.exe" -DestinationPath "${{ matrix.archive }}" | |
| Remove-Item "sv.exe" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.archive }} | |
| path: ${{ matrix.archive }} | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| cd artifacts | |
| sha256sum * > checksums.txt | |
| cat checksums.txt | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| artifacts/* | |
| generate_release_notes: true |