inspect-cert-chain 0.0.18

OpenSSL-like text output for debugging certificate chains
name: CD

on:
  release:
    types: [published]

permissions:
  contents: write
  id-token: write
  attestations: write

env:
  CARGO_INCREMENTAL: 0
  CARGO_NET_GIT_FETCH_WITH_CLI: true
  CARGO_NET_RETRY: 10
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  RUSTUP_MAX_RETRIES: 10

defaults:
  run:
    shell: bash

jobs:
  upload-assets:
    strategy:
      fail-fast: false
      matrix:
        include:
          - { os: macos-latest, target: aarch64-apple-darwin }
          - { os: macos-latest, target: universal-apple-darwin }
          - { os: macos-latest, target: x86_64-apple-darwin }
          - { os: ubuntu-latest, target: aarch64-unknown-linux-gnu }
          - { os: ubuntu-latest, target: aarch64-unknown-linux-musl }
          # - { os: ubuntu-latest, target: x86_64-unknown-freebsd } # not supported by aws-lc
          - { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
          - { os: ubuntu-latest, target: x86_64-unknown-linux-musl }
          # - { os: windows-latest, target: aarch64-pc-windows-msvc } # not supported by aws-lc
          - { os: windows-latest, target: x86_64-pc-windows-msvc }

    name: Deploy (${{ matrix.target }})
    runs-on: ${{ matrix.os }}
    if: github.repository_owner == 'robjtede' && startsWith(github.event.release.name, 'v')
    timeout-minutes: 60

    steps:
      - uses: actions/checkout@v4

      - name: Install nasm
        if: matrix.target.os == 'windows-latest'
        uses: ilammy/setup-nasm@v1.5.1

      - name: Install Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
        with:
          cache: false

      - uses: taiki-e/setup-cross-toolchain-action@v1.22.0
        with:
          target: ${{ matrix.target }}

      # TODO: see if this is needed after next deploy
      # - if: endsWith(matrix.target, 'windows-msvc')
      #   run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"

      - name: Build and upload to release
        id: upload-release
        uses: taiki-e/upload-rust-binary-action@v1.21.0
        with:
          bin: inspect-cert-chain
          target: ${{ matrix.target }}
          checksum: sha256
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Generate artifact attestation
        uses: actions/attest-build-provenance@v1
        with:
          subject-path: "${{ steps.upload-release.outputs.archive }}.*"