Rust Release #17
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: Rust Release | |
| on: | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --release | |
| - name: Extract version from Cargo.toml | |
| id: version | |
| shell: bash | |
| run: | | |
| ver=$(grep '^version =' Cargo.toml | sed -E 's/version = "(.*)"/\1/') | |
| echo "version=$ver" >> $GITHUB_OUTPUT | |
| - name: Get last commit message | |
| id: changelog | |
| shell: bash | |
| run: | | |
| msg=$(git log -1 --pretty=format:"%s") | |
| echo "msg=$msg" >> $GITHUB_OUTPUT | |
| - name: Create release archive | |
| shell: bash | |
| run: | | |
| mkdir -p release_pkg | |
| cp target/release/voxelproxy.exe release_pkg/ | |
| cp windivert/WinDivert.dll release_pkg/ | |
| cp windivert/WinDivert64.sys release_pkg/ | |
| cd release_pkg | |
| 7z a ../voxelproxy-${{ steps.version.outputs.version }}.zip . | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.version }} | |
| name: Release ${{ steps.version.outputs.version }} | |
| body: ${{ steps.changelog.outputs.msg }} | |
| files: voxelproxy-${{ steps.version.outputs.version }}.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |