name: Create executables

# GitHub events that trigger the workflow:
on:
  workflow_call: # to make the workflow triggerable from other workflows
  workflow_dispatch: # to make the workflow triggerable manually

jobs:
  create_executables:
    name: For ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, ubuntu-22.04-arm, macos-latest, windows-latest]

    runs-on: ${{ matrix.os }}
    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v6

      - name: Install uv
        uses: astral-sh/setup-uv@v7

      - name: Install just
        uses: taiki-e/install-action@just

      - name: Create executable
        run: just create-executable

      - name: Upload executable as an artifact
        uses: actions/upload-artifact@v5
        with:
          name: rendercv-${{ matrix.os }}
          path: bin/*
