Release #8
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[0-9]+.*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| create-release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| version: ${{ steps.get_version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get version from tag | |
| id: get_version | |
| run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Verify version matches Cargo.toml | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| CARGO_VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/') | |
| echo "Tag version: $TAG_VERSION" | |
| echo "Cargo.toml version: $CARGO_VERSION" | |
| if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then | |
| echo "::error::Version mismatch! Tag is v$TAG_VERSION but Cargo.toml has $CARGO_VERSION" | |
| exit 1 | |
| fi | |
| echo "✓ Versions match" | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }} | |
| body: | | |
| ## sinqtt ${{ github.ref_name }} | |
| ### Installation | |
| Download the appropriate binary for your platform and make it executable: | |
| ```bash | |
| chmod +x sinqtt-* | |
| sudo mv sinqtt-* /usr/local/bin/sinqtt | |
| ``` | |
| ### Platforms | |
| | Platform | Architecture | File | | |
| |----------|--------------|------| | |
| | Linux | x86_64 | `sinqtt-linux-x86_64` | | |
| | Linux | aarch64 (ARM64) | `sinqtt-linux-aarch64` | | |
| | Linux | armv7 (Raspberry Pi) | `sinqtt-linux-armv7` | | |
| | macOS | x86_64 (Intel) | `sinqtt-darwin-x86_64` | | |
| | macOS | aarch64 (Apple Silicon) | `sinqtt-darwin-aarch64` | | |
| | Windows | x86_64 | `sinqtt-windows-x86_64.exe` | | |
| build-linux: | |
| name: Build Linux | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| artifact: sinqtt-linux-x86_64 | |
| - target: aarch64-unknown-linux-gnu | |
| artifact: sinqtt-linux-aarch64 | |
| - target: armv7-unknown-linux-gnueabihf | |
| artifact: sinqtt-linux-armv7 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Build | |
| run: cross build --release --target ${{ matrix.target }} | |
| - name: Prepare artifact | |
| run: | | |
| cp target/${{ matrix.target }}/release/sinqtt ${{ matrix.artifact }} | |
| chmod +x ${{ matrix.artifact }} | |
| - name: Upload artifact | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| asset_path: ./${{ matrix.artifact }} | |
| asset_name: ${{ matrix.artifact }} | |
| asset_content_type: application/octet-stream | |
| - name: Create checksum | |
| run: sha256sum ${{ matrix.artifact }} > ${{ matrix.artifact }}.sha256 | |
| - name: Upload checksum | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| asset_path: ./${{ matrix.artifact }}.sha256 | |
| asset_name: ${{ matrix.artifact }}.sha256 | |
| asset_content_type: text/plain | |
| build-macos: | |
| name: Build macOS | |
| needs: create-release | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-apple-darwin | |
| artifact: sinqtt-darwin-x86_64 | |
| - target: aarch64-apple-darwin | |
| artifact: sinqtt-darwin-aarch64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Prepare artifact | |
| run: | | |
| cp target/${{ matrix.target }}/release/sinqtt ${{ matrix.artifact }} | |
| chmod +x ${{ matrix.artifact }} | |
| - name: Upload artifact | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| asset_path: ./${{ matrix.artifact }} | |
| asset_name: ${{ matrix.artifact }} | |
| asset_content_type: application/octet-stream | |
| - name: Create checksum | |
| run: shasum -a 256 ${{ matrix.artifact }} > ${{ matrix.artifact }}.sha256 | |
| - name: Upload checksum | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| asset_path: ./${{ matrix.artifact }}.sha256 | |
| asset_name: ${{ matrix.artifact }}.sha256 | |
| asset_content_type: text/plain | |
| build-windows: | |
| name: Build Windows | |
| needs: create-release | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build | |
| run: cargo build --release | |
| - name: Prepare artifact | |
| run: copy target\release\sinqtt.exe sinqtt-windows-x86_64.exe | |
| - name: Upload artifact | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| asset_path: ./sinqtt-windows-x86_64.exe | |
| asset_name: sinqtt-windows-x86_64.exe | |
| asset_content_type: application/octet-stream | |
| - name: Create checksum | |
| run: (Get-FileHash sinqtt-windows-x86_64.exe -Algorithm SHA256).Hash.ToLower() + " sinqtt-windows-x86_64.exe" | Out-File -Encoding ASCII sinqtt-windows-x86_64.exe.sha256 | |
| - name: Upload checksum | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| asset_path: ./sinqtt-windows-x86_64.exe.sha256 | |
| asset_name: sinqtt-windows-x86_64.exe.sha256 | |
| asset_content_type: text/plain |