git-status-vars 1.3.0

Summarize git repo info into shell variables (for use in a prompt)
Documentation
# Mostly copied from https://github.com/taiki-e/cargo-hack/blob/72a9fc95377c453a18026329577c59fa60bfa737/.github/workflows/release.yml
name: Release

permissions:
  # TODO: once `releases: write` is supported, use it instead.
  contents: write

on:
  push:
    tags:
      - v*.*.*

env:
  CARGO_INCREMENTAL: 0
  CARGO_NET_RETRY: 10
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  RUSTFLAGS: -D warnings
  RUSTUP_MAX_RETRIES: 10

defaults:
  run:
    # Setting shell: bash explicitly activates pipefail
    shell: bash

jobs:
  create-release:
    if: github.repository_owner == 'danielparks'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
        with:
          persist-credentials: false
      - name: Install Rust
        run: rustup update stable --no-self-update
      - run: cargo package
      - uses: taiki-e/create-gh-release-action@v1
        with:
          changelog: CHANGELOG.md
          title: Release $version
          branch: main
          token: ${{ secrets.GITHUB_TOKEN }}

  upload-assets:
    name: ${{ matrix.target }}
    if: github.repository_owner == 'danielparks'
    needs:
      - create-release
    strategy:
      matrix:
        include:
          - target: aarch64-unknown-linux-gnu
          - target: aarch64-unknown-linux-musl
          - target: aarch64-apple-darwin
            os: macos-14
          - target: aarch64-pc-windows-msvc
            os: windows-latest
          - target: x86_64-unknown-linux-gnu
          - target: x86_64-unknown-linux-musl
          - target: x86_64-apple-darwin
            os: macos-13
          - target: x86_64-pc-windows-msvc
            os: windows-latest
          - target: x86_64-unknown-freebsd
    runs-on: ${{ matrix.os || 'ubuntu-latest' }}
    steps:
      - uses: actions/checkout@v5
        with:
          persist-credentials: false
      - name: Install Rust
        run: rustup update stable --no-self-update
      - uses: taiki-e/setup-cross-toolchain-action@v1
        with:
          target: ${{ matrix.target }}
        if: (matrix.os == '' || startsWith(matrix.os, 'ubuntu')) && !contains(matrix.target, '-musl')
      - uses: taiki-e/install-action@cross
        if: contains(matrix.target, '-musl')
      - run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
        if: endsWith(matrix.target, 'windows-msvc')
      - uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
            target/
          key: cargo-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
      - uses: taiki-e/upload-rust-binary-action@v1
        with:
          bin: git-status-vars
          target: ${{ matrix.target }}
          tar: all
          zip: windows
          token: ${{ secrets.GITHUB_TOKEN }}