name: Build

on:
  pull_request:
    paths:
      - '**.c'
      - '**.h'
      - '**.in'
      - '**.sh'
      - '**.py'
      - '**.java'
      - .github/workflows/ci.yml
  push:


jobs:
  virtualsmartcard-macos:
    runs-on: macos-11
    steps:
    - uses: actions/checkout@v2
    - run: .github/build-virtualsmartcard.sh macos
    - uses: actions/upload-artifact@v2
      with:
        name: virtualsmartcard-macos
        path:
          virtualsmartcard/virtualsmartcard*.dmg

  virtualsmartcard-ubuntu:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - run: .github/build-virtualsmartcard.sh ubuntu
    - uses: actions/upload-artifact@v2
      with:
        name: virtualsmartcard
        path:
          virtualsmartcard/virtualsmartcard*.tar.gz

  ccid-ubuntu:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - run: .github/build-ccid.sh ubuntu
    - uses: actions/upload-artifact@v2
      with:
        name: ccid-emulator
        path:
          ccid/ccid-emulator*.tar.gz

  pcsc-relay-macos:
    runs-on: macos-11
    steps:
    - uses: actions/checkout@v2
    - run: .github/build-pcsc-relay.sh macos

  pcsc-relay-ubuntu:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - run: .github/build-pcsc-relay.sh ubuntu
    - uses: actions/upload-artifact@v2
      with:
        name: pcsc-relay
        path:
          pcsc-relay/pcsc-relay*.tar.gz

#  pcsc-relay-mingw-32:
#    runs-on: ubuntu-20.04
#    steps:
#    - uses: actions/checkout@v2
#    - run: .github/build-pcsc-relay.sh mingw-32

  pcsc-relay-mingw-64:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - run: .github/build-pcsc-relay.sh mingw-64
    - uses: actions/upload-artifact@v2
      with:
        name: pcsc-relay-mingw-64
        path:
          pcsc-relay/src/pcsc-relay.exe

  remote-reader-ubuntu:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - run: .github/build-remote-reader.sh
    - uses: actions/upload-artifact@v2
      with:
        name: remote-reader
        path:
          remote-reader/app/build/outputs/apk

  ACardEmulator-ubuntu:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - run: .github/build-ACardEmulator.sh
    - uses: actions/upload-artifact@v2
      with:
        name: ACardEmulator
        path:
          ACardEmulator/app/build/outputs/apk
