fix: bedrock message SSE frames with event type (#1261) #11
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*" | |
| jobs: | |
| verify: | |
| name: Verify release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Check tag matches Cargo.toml version | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| tag_version="${GITHUB_REF_NAME#v}" | |
| cargo_version="$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')" | |
| if [ "$tag_version" != "$cargo_version" ]; then | |
| echo "Tag version ($tag_version) does not match Cargo.toml version ($cargo_version)." | |
| exit 1 | |
| fi | |
| - name: Check crate package | |
| run: cargo publish --dry-run | |
| build: | |
| name: Build ${{ matrix.asset_name }} | |
| runs-on: ${{ matrix.runs_on }} | |
| needs: verify | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runs_on: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| asset_name: yomo-amd64-linux.tar.gz | |
| binary_name: yomo | |
| use_cross: false | |
| - runs_on: ubuntu-latest | |
| target: aarch64-unknown-linux-gnu | |
| asset_name: yomo-arm64-linux.tar.gz | |
| binary_name: yomo | |
| use_cross: true | |
| - runs_on: macos-latest | |
| target: aarch64-apple-darwin | |
| asset_name: yomo-arm64-darwin.tar.gz | |
| binary_name: yomo | |
| use_cross: false | |
| - runs_on: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| asset_name: yomo-amd64-windows.tar.gz | |
| binary_name: yomo.exe | |
| use_cross: false | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| if: matrix.use_cross | |
| run: cargo install cross --locked | |
| - name: Build | |
| shell: bash | |
| env: | |
| CARGO_TERM_COLOR: always | |
| run: | | |
| set -euo pipefail | |
| if [ "${{ matrix.use_cross }}" = "true" ]; then | |
| cross build --release --target "${{ matrix.target }}" | |
| else | |
| cargo build --release --target "${{ matrix.target }}" | |
| fi | |
| - name: Package | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| dist_dir="dist" | |
| package_dir="$dist_dir/${{ matrix.asset_name }}.dir" | |
| mkdir -p "$package_dir" | |
| cp "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" "$package_dir/" | |
| tar -czf "$dist_dir/${{ matrix.asset_name }}" -C "$package_dir" . | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.asset_name }} | |
| path: dist/${{ matrix.asset_name }} | |
| if-no-files-found: error | |
| publish-crate: | |
| name: Publish crate | |
| runs-on: ubuntu-latest | |
| needs: | |
| - verify | |
| - build | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Publish to crates.io | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| run: cargo publish | |
| release: | |
| name: Publish GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - publish-crate | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Generate hashes | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| sha256sum dist/*.tar.gz > dist/hashes.txt | |
| - name: Publish release assets | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: | | |
| dist/yomo-arm64-darwin.tar.gz | |
| dist/yomo-amd64-windows.tar.gz | |
| dist/yomo-amd64-linux.tar.gz | |
| dist/yomo-arm64-linux.tar.gz | |
| dist/hashes.txt |