Migration to .NET 10 #3325
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
| name: CI Pipeline | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main, hotfix/*] | |
| release: | |
| types: [published] | |
| env: | |
| SOLUTION_FILE_PATH: MobiFlightConnector.sln | |
| INSTALLER_SOLUTION_FILE_PATH: MobiFlightInstaller.sln | |
| BUILD_CONFIGURATION: Release | |
| BUILD_PLATFORM: x86 | |
| VERSION: ${{ github.event_name == 'release' && github.event.release.tag_name || format('0.0.{0}.{1}', github.event.number, github.run_number) }} | |
| INSTALLER_OUTPUT: dist/MobiFlightInstaller | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.x | |
| architecture: "${{ env.BUILD_PLATFORM }}" | |
| - name: Build frontend | |
| run: | | |
| cd src/MobiFlightConnector/frontend | |
| npm install | |
| npm run build | |
| - name: Create artifacts | |
| run: mkdir dist | |
| - name: Build and publish connector | |
| uses: ./.github/actions/build | |
| with: | |
| solution_file: ${{ env.SOLUTION_FILE_PATH }} | |
| project_file: src/MobiFlightConnector/MobiFlightConnector.csproj | |
| build_configuration: Release | |
| build_platform: ${{ env.BUILD_PLATFORM }} | |
| test_projects: ${{ env.SOLUTION_FILE_PATH }} | |
| publish_path: ${{ github.workspace }}/dist/MobiFlightConnector-${{ env.VERSION }} | |
| publish_version: ${{ env.VERSION }} | |
| - name: Build and publish installer | |
| uses: ./.github/actions/build | |
| with: | |
| solution_file: ${{ env.INSTALLER_SOLUTION_FILE_PATH }} | |
| project_file: src/MobiFlight-Installer/MobiFlightInstaller.csproj | |
| build_configuration: Release | |
| publish_path: ${{ github.workspace }}/${{ env.INSTALLER_OUTPUT }} | |
| use_msbuild: true | |
| - name: package | |
| run: | | |
| Copy-Item -Path "${{ github.workspace }}/${{ env.INSTALLER_OUTPUT }}/MobiFlight-Installer.exe" -Destination "${{ github.workspace }}/dist/MobiFlightConnector-${{ env.VERSION }}" | |
| & "${{ github.workspace }}\Build\utils\7z\7z.exe" a ${{ github.workspace }}/dist/MobiFlightConnector-${{ env.VERSION }}.zip ${{ github.workspace }}/dist/MobiFlightConnector-${{ env.VERSION }} -r | |
| - name: store latest setup file | |
| if: github.event_name != 'release' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: MobiFlightConnector | |
| path: | | |
| dist/MobiFlightConnector-${{ env.VERSION }}.zip | |
| # Only run the following steps if this is a release event | |
| - uses: repolevedavaj/install-nsis@v1.2.1 | |
| if: github.event_name == 'release' | |
| with: | |
| nsis-version: '3.10' | |
| - name: Create hash | |
| if: github.event_name == 'release' | |
| shell: pwsh | |
| run: (Get-FileHash dist/MobiFlightConnector-${{ env.VERSION }}.zip -Algorithm SHA1).Hash | Out-File dist/MobiFlightConnector-${{ env.VERSION }}.sha1 | |
| - name: Create setup exe | |
| if: github.event_name == 'release' | |
| uses: joncloud/makensis-action@v4 | |
| with: | |
| script-file: ./Build/setup.nsi | |
| arguments: "/V3" | |
| - name: Upload release assets | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: | | |
| dist/MobiFlightConnector-${{ env.VERSION }}.zip | |
| dist/MobiFlightConnector-${{ env.VERSION }}.sha1 | |
| Build/MobiFlight-Setup.exe |