fix(bindings): fire all matching bindings, honor ReceiveChar (#18) #10
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]+.[0-9]+.[0-9]+*"] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to publish (must already exist)" | |
| required: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target.name }} | |
| runs-on: ${{ matrix.target.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - name: x86_64-linux | |
| runner: ubuntu-latest | |
| triple: x86_64-unknown-linux-gnu | |
| archive: tar.gz | |
| bin: alacritree | |
| - name: aarch64-linux | |
| runner: ubuntu-24.04-arm | |
| triple: aarch64-unknown-linux-gnu | |
| archive: tar.gz | |
| bin: alacritree | |
| - name: aarch64-macos | |
| runner: macos-14 | |
| triple: aarch64-apple-darwin | |
| archive: tar.gz | |
| bin: alacritree | |
| - name: x86_64-windows | |
| runner: windows-latest | |
| triple: x86_64-pc-windows-msvc | |
| archive: zip | |
| bin: alacritree.exe | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Linux system dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| cmake pkg-config \ | |
| libfreetype6-dev libfontconfig1-dev \ | |
| libxkbcommon-dev libxcb-shape0-dev libxcb-xfixes0-dev \ | |
| libwayland-dev libgl1-mesa-dev libegl1-mesa-dev | |
| - name: Install macOS system dependencies | |
| if: runner.os == 'macOS' | |
| run: brew install cmake pkg-config fontconfig freetype | |
| - name: Add Rust target | |
| run: rustup target add ${{ matrix.target.triple }} | |
| - name: Build | |
| run: cargo build -p alacritree --release --locked --target ${{ matrix.target.triple }} | |
| - name: Resolve release tag | |
| id: tag | |
| shell: bash | |
| run: | | |
| if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then | |
| echo "value=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Package (tar.gz) | |
| if: matrix.target.archive == 'tar.gz' | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| asset="alacritree-${{ steps.tag.outputs.value }}-${{ matrix.target.name }}.tar.gz" | |
| stage="$(mktemp -d)" | |
| cp "target/${{ matrix.target.triple }}/release/${{ matrix.target.bin }}" "$stage/" | |
| # Linux packagers (AUR alacritree-bin, downstream distros) need the | |
| # XDG metadata to wire up rofi/drun and icon themes. macOS doesn't | |
| # consume these files, so we only bundle them on Linux. | |
| if [[ "${{ runner.os }}" == "Linux" ]]; then | |
| cp alacritree/assets/alacritree.desktop "$stage/" | |
| for size in 16 24 32 48 64 128 256 512; do | |
| cp "alacritree/assets/icon-${size}.png" "$stage/alacritree-${size}.png" | |
| done | |
| fi | |
| tar -C "$stage" -czf "$asset" . | |
| echo "ASSET=$asset" >> "$GITHUB_ENV" | |
| - name: Package (zip) | |
| if: matrix.target.archive == 'zip' | |
| shell: pwsh | |
| run: | | |
| $asset = "alacritree-${{ steps.tag.outputs.value }}-${{ matrix.target.name }}.zip" | |
| Compress-Archive ` | |
| -Path "target/${{ matrix.target.triple }}/release/${{ matrix.target.bin }}" ` | |
| -DestinationPath $asset | |
| "ASSET=$asset" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: alacritree-${{ matrix.target.name }} | |
| path: ${{ env.ASSET }} | |
| if-no-files-found: error | |
| retention-days: 7 | |
| release: | |
| name: Publish release | |
| runs-on: ubuntu-latest | |
| # `always()` so a partial matrix (e.g. only Linux building cleanly today) | |
| # still produces a release with whatever artifacts succeeded. | |
| if: always() && needs.build.result != 'cancelled' | |
| needs: build | |
| permissions: | |
| # `actions: write` is required so the final step can dispatch the | |
| # scoop-update and aur-bin-publish workflows via `gh workflow run`. | |
| contents: write | |
| actions: write | |
| steps: | |
| - name: Resolve release tag | |
| id: tag | |
| run: | | |
| if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then | |
| echo "value=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: List artifacts | |
| run: ls -la dist/ | |
| - name: Create or update GitHub release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ steps.tag.outputs.value }} | |
| run: | | |
| set -euo pipefail | |
| shopt -s nullglob | |
| assets=(dist/*) | |
| if [[ ${#assets[@]} -eq 0 ]]; then | |
| echo "No artifacts to publish; aborting." >&2 | |
| exit 1 | |
| fi | |
| if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then | |
| gh release upload "$TAG" "${assets[@]}" --repo "$GITHUB_REPOSITORY" --clobber | |
| else | |
| gh release create "$TAG" \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --title "$TAG" \ | |
| --generate-notes \ | |
| "${assets[@]}" | |
| fi | |
| - name: Fan out to downstream publish workflows | |
| # `release: published` events fired by GITHUB_TOKEN don't trigger | |
| # other workflows (loop-prevention), so we explicitly dispatch the | |
| # scoop and aur-bin bumps here. `workflow_dispatch` is the one | |
| # event class that IS allowed to chain. | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ steps.tag.outputs.value }} | |
| run: | | |
| set -euo pipefail | |
| for wf in scoop-update.yml aur-bin-publish.yml; do | |
| echo "Dispatching $wf for $TAG" | |
| gh workflow run "$wf" --repo "$GITHUB_REPOSITORY" --ref master -f "tag=$TAG" | |
| done |