name: Publish artifacts to Github

on: workflow_dispatch
    
jobs:

  build_job:
    uses: ./.github/workflows/BuildPackages.yml
    with:
      version-suffix: Preview-$(date +'%Y%m%d-%H%M%S')"

  publish_job:
    needs: build_job
    runs-on: ubuntu-latest

    steps:

    - name: Download all artifacts
      uses: actions/download-artifact@v4
      with:
        name: nuget-packages

    - name: Push to NuGet
      run: dotnet nuget push "*.nupkg" --api-key ${{secrets.SharpGLTF_PublishToGithub}} --source https://nuget.pkg.github.com/${{github.repository_owner}}
