bump version #84
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: .NET | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 | |
| # Avoid building FBXCSharp in the workflow | |
| # I do this because I don't want to/I don't know how to include the FBX SDK in Github Actions | |
| # If anyone knows how to include it painlessly, please let me know | |
| - name: Find prebuilt FBXCSharp.dll in releases | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| $headers = @{ Authorization = "Bearer $env:GITHUB_TOKEN" } | |
| $releases = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/releases" -Headers $headers | |
| $fbxRelease = $releases | | |
| Where-Object { $_.tag_name -like "fbxcsharp-prebuilt-*" -and -not $_.draft } | | |
| Sort-Object { [datetime]$_.created_at } -Descending | | |
| Select-Object -First 1 | |
| $asset = $fbxRelease.assets | Where-Object { $_.name -eq "FBXCSharp.dll" } | Select-Object -First 1 | |
| if (-not $asset) { | |
| Write-Error "FBXCSharp.dll not found in latest fbxcsharp-prebuilt-* release." | |
| exit 1 | |
| } | |
| echo "PREBUILT_DLL_URL=$($asset.browser_download_url)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 | |
| - name: Fetch prebuilt FBXCSharp.dll | |
| run: | | |
| mkdir prebuilt | |
| Invoke-WebRequest -Uri $env:PREBUILT_DLL_URL -OutFile "prebuilt\FBXCSharp.dll" | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Publish ZoneFbx CLI | |
| run: dotnet publish ZoneFbx/ZoneFbx.csproj --no-restore --configuration GithubRelease --output .\publish\ZoneFbxCLI | |
| - name: Publish ZoneFbx.GUI | |
| run: dotnet publish ZoneFbx.GUI/ZoneFbx.GUI.csproj --no-restore --configuration GithubRelease --output .\publish\ZoneFbx.GUI | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal --configuration GithubRelease | |
| - name: Pack release archives | |
| run: | | |
| mkdir release | |
| Copy-Item -Path .\publish\ZoneFbxCLI -Destination .\publish\ZoneFbx.GUI\ZoneFbxCLI -Recurse | |
| Compress-Archive -Path .\publish\ZoneFbx.GUI\* -DestinationPath .\release\ZoneFbx.GUI_${{ github.ref_name }}.zip -Force | |
| - name: Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ZoneFbx.GUI ${{ github.ref_name }} | |
| files: release/** | |
| generate_release_notes: true |