feat(cabin): add remote registry publish behind -Z remote-registry #318
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: Dist | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_call: | |
| permissions: | |
| contents: read | |
| jobs: | |
| demo: | |
| runs-on: ubuntu-26.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - parallel: | |
| - name: Install build/demo tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| ninja-build gcc g++ \ | |
| ffmpeg ttyd \ | |
| bat zsh | |
| # Ubuntu ships bat as `batcat`; expose it as `bat` for the demo. | |
| sudo ln -sf "$(command -v batcat)" /usr/local/bin/bat | |
| - name: Build and Install Cabin Binary (release) | |
| run: | | |
| cargo build --bin cabin --release --locked | |
| sudo cp target/release/cabin /usr/local/bin | |
| - name: Install VHS | |
| run: | | |
| wget https://github.com/charmbracelet/vhs/releases/download/v0.11.0/vhs_0.11.0_Linux_x86_64.tar.gz | |
| tar -xzf vhs_0.11.0_Linux_x86_64.tar.gz | |
| sudo mv vhs_0.11.0_Linux_x86_64/vhs /usr/local/bin | |
| - name: Install Nerd Font | |
| run: | | |
| mkdir -p ~/.local/share/fonts | |
| wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FiraCode.zip | |
| unzip FiraCode.zip -d ~/.local/share/fonts/ | |
| fc-cache -fv | |
| - name: Install zsh-syntax-highlighting | |
| run: | | |
| git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/z | |
| echo 'source ~/z/zsh-syntax-highlighting.zsh' >> ~/.zshrc | |
| - name: Install Starship | |
| run: | | |
| curl -sS https://starship.rs/install.sh | sh -s -- -y | |
| printf "%s\n" "eval \"\$(starship init zsh)\"" >> ~/.zshrc | |
| - name: Generate a new demo | |
| run: vhs demo.tape | |
| - name: Upload demo | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: demo.gif | |
| archive: false | |
| if-no-files-found: error | |
| binaries: | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| runner: ubuntu-24.04 | |
| - target: x86_64-pc-windows-msvc | |
| runner: windows-2025-vs2026 | |
| - target: aarch64-unknown-linux-gnu | |
| runner: ubuntu-24.04-arm | |
| - target: aarch64-apple-darwin | |
| runner: macos-26 | |
| - target: aarch64-pc-windows-msvc | |
| runner: windows-11-vs2026-arm | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build binary | |
| shell: bash | |
| run: cargo build --bin cabin --release --locked --target "${{ matrix.target }}" | |
| - name: Package binary | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| target="${{ matrix.target }}" | |
| version="${GITHUB_REF_NAME}" | |
| if [[ "${GITHUB_REF_TYPE:-}" != "tag" ]]; then | |
| version="dev-${GITHUB_SHA::12}" | |
| fi | |
| bin="cabin" | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| bin="cabin.exe" | |
| fi | |
| package="cabin-${version}-${target}" | |
| mkdir -p "$package" | |
| cp "target/${target}/release/${bin}" "$package/" | |
| cp README.md LICENSE "$package/" | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| package_path="${package}.zip" | |
| powershell -NoProfile -Command \ | |
| "Compress-Archive -Path '${package}' -DestinationPath '${package_path}' -Force" | |
| else | |
| package_path="${package}.tar.xz" | |
| tar -cJf "${package_path}" "$package" | |
| fi | |
| echo "PACKAGE_PATH=${package_path}" >> "$GITHUB_ENV" | |
| - name: Upload binary archive | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: ${{ env.PACKAGE_PATH }} | |
| archive: false | |
| if-no-files-found: error | |
| checksums: | |
| runs-on: ubuntu-24.04 | |
| needs: binaries | |
| steps: | |
| - name: Download binary archives | |
| uses: actions/download-artifact@v8 | |
| with: | |
| pattern: cabin-* | |
| path: artifacts | |
| merge-multiple: true | |
| skip-decompress: true | |
| - name: Generate checksums | |
| shell: bash | |
| working-directory: artifacts | |
| run: | | |
| set -euo pipefail | |
| shopt -s nullglob | |
| files=(*.tar.xz *.zip) | |
| ((${#files[@]})) || { echo "no binary archives found" >&2; exit 1; } | |
| : > sha256.sum | |
| for file in "${files[@]}"; do | |
| sha256sum -b "$file" | tee "${file}.sha256" >> sha256.sum | |
| done | |
| cat sha256.sum | |
| - name: Upload checksums | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: checksums | |
| path: | | |
| artifacts/sha256.sum | |
| artifacts/*.sha256 | |
| if-no-files-found: error |