choco 0.2.2

markup language for dialogue systems
Documentation
name: Release Gui

on: push

permissions:
  contents: write

env:
  RUSTFLAGS: -Dwarnings

jobs:
  package:
    name: ${{format('Package ({0})', matrix.name)}}
    if: startsWith(github.ref, 'refs/tags/')
    runs-on: ${{ matrix.os }}-latest
    timeout-minutes: 45
    strategy:
      fail-fast: false
      matrix:
        name: [Windows, Linux, MacOS, MacArm64]
        include:
          - name: Windows
            os: windows
            extension: exe
          - name: Linux
            os: ubuntu
          - name: MacOS
            os: macos
            target: x86_64-apple-darwin
          - name: MacArm64
            os: macos
            target: aarch64-apple-darwin
    env:
      target: ${{matrix.target && format('--target={0}', matrix.target)}}
      dir-prefix: ${{matrix.target && format('{0}/', matrix.target)}}
      extension: ${{matrix.extension && format('.{0}', matrix.extension)}}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{matrix.target}}
      - if: matrix.os == 'ubuntu'
        run: sudo apt-get install librust-atk-dev && sudo apt-get install libgtk-3-dev
      - run: cargo build -p chocobrew --release ${{env.target}}
      - uses: actions/upload-artifact@v4
        with:
          name: ${{format('{0}', matrix.target || matrix.os)}}
          path: target/${{env.dir-prefix}}release/chocobrew${{env.extension}}

  publish:
    name: Publish
    needs: package
    runs-on: ubuntu-latest
    timeout-minutes: 45
    steps:
      - uses: actions/checkout@v4
      - uses: actions/download-artifact@v4
      - run: mv ubuntu/* chocobrew-linux
      - run: mv windows/* chocobrew-windows.exe
      - run: mv aarch64-apple-darwin/* chocobrew-macos-arm64
      - run: mv x86_64-apple-darwin/* chocobrew-macos
      - uses: softprops/action-gh-release@v1
        with:
          files: |
            chocobrew-linux
            chocobrew-windows.exe
            chocobrew-macos-arm64
            chocobrew-macos