name: Package Application with Pyinstaller

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Package Application
      uses: JackMcKew/pyinstaller-action-linux@main
      with:
        path: .

    - run: chmod +x PkgTool.Core && cp -r PkgTool.Core dist/linux/dlcIndex

    - uses: actions/upload-artifact@v2
      with:
        name: dlcIndex-linux
        path: dist/linux

    - name: Package Application
      uses: JackMcKew/pyinstaller-action-windows@main
      with:
        path: .

    - run: cp -r LibOrbisPkg.dll dist/windows/dlcIndex && cp -r PkgTool.exe dist/windows/dlcIndex

    - uses: actions/upload-artifact@v2
      with:
        name: dlcIndex-windows
        path: dist/windows
