feat: add automated releases and install script #1
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*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| suffix: "" | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| suffix: "" | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| suffix: .exe | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| suffix: "" | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| suffix: "" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install musl tools | |
| if: matrix.target == 'x86_64-unknown-linux-musl' | |
| run: sudo apt-get install -y musl-tools | |
| - name: Build binary | |
| run: cargo build --verbose --release --target ${{ matrix.target }} | |
| - name: Strip binary (linux and macos) | |
| if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | |
| run: strip target/${{ matrix.target }}/release/wt${{ matrix.suffix }} | |
| - name: Package binary | |
| shell: bash | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
| 7z a ../../../wt-${{ matrix.target }}.zip wt.exe | |
| else | |
| tar czvf ../../../wt-${{ matrix.target }}.tar.gz wt | |
| fi | |
| - name: Upload binary to release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: wt-${{ matrix.target }}.* | |
| file_glob: true | |
| tag: ${{ github.ref }} | |
| overwrite: true |