Build Printtool #380
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: Build Printtool | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 3' | |
| push: | |
| paths-ignore: | |
| - .azure-pipelines/** | |
| - .devcontainer/** | |
| - .vscode/** | |
| - .github/workflows/refactored.yml | |
| workflow_dispatch: | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
| #Specifies whether .NET welcome and telemetry messages are displayed on the first run. | |
| DOTNET_NOLOGO: true | |
| #Specifies whether to generate an ASP.NET Core certificate. | |
| DOTNET_GENERATE_ASPNET_CERTIFICATE: false | |
| NUGET_PACKAGES: '${{github.workspace}}/.nuget/packages' | |
| defaults: | |
| run: | |
| shell: pwsh | |
| jobs: | |
| build_windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - run: dotnet restore --locked-mode | |
| - run: dotnet build ${{github.workspace}}/PrintTool/PrintTool.csproj --no-restore -c Release -a x64 | |
| - run: dotnet build ${{github.workspace}}/PrintTool.UnitTests/PrintTool.UnitTests.csproj --no-restore -c Release -a x64 | |
| - run: dotnet publish ${{github.workspace}}/PrintTool/PrintTool.csproj -a x64 --output ${{github.workspace}}/artifacts/PrintToolWindows --no-restore -c Release | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: PrintToolWindows | |
| path: '${{github.workspace}}/artifacts/PrintToolWindows' | |
| build_linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| - run: dotnet restore --locked-mode | |
| - run: dotnet build ${{github.workspace}}/PrintTool/PrintTool.csproj --no-restore -c Release -a x64 | |
| - run: dotnet build ${{github.workspace}}/PrintTool.UnitTests/PrintTool.UnitTests.csproj --no-restore -c Release -a x64 | |
| - run: dotnet publish ${{github.workspace}}/PrintTool/PrintTool.csproj -a x64 --output ${{github.workspace}}/artifacts/PrintToolLinux --no-restore -c Release | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: PrintToolLinux | |
| path: '${{github.workspace}}/artifacts/PrintToolLinux' | |
| deploy_windows: | |
| runs-on: windows-latest | |
| needs: [build_windows] | |
| environment: printool_windows | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: PrintToolWindows | |
| path: ${{github.workspace}}/artifacts | |
| - run: ${{github.workspace}}/artifacts/PrintTool.exe "Hello" "world" "windows" | |
| deploy_linux: | |
| runs-on: ubuntu-latest | |
| needs: [build_linux] | |
| environment: printool_linux | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: PrintToolLinux | |
| path: ${{github.workspace}}/artifacts | |
| - run: chmod 777 ${{github.workspace}}/artifacts/PrintTool | |
| - run: ${{github.workspace}}/artifacts/PrintTool "Hello" "world" "linux" |