✏️ Bump version #9
Workflow file for this run
This file contains 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: .NET Core Desktop | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Release] | |
targetplatform: [x64] | |
defaults: | |
run: | |
working-directory: ./src | |
runs-on: windows-latest | |
env: | |
Solution_Path: Watermarker.sln | |
TargetApplicationProjectFile: Watermarker.csproj | |
InstallerApplicationProjectFile: Watermarker.Installer.csproj | |
TargetApplicationDirectory: Watermarker | |
InsatllerApplicationDirectory: Watermarker.Installer | |
ZipPrefix: watermarker | |
ZipInstaller: watermarker-installer.zip | |
ArtifactName: WatermarkerInstaller | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Install the .NET Core workload | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
# Restore the application to populate the obj folder with RuntimeIdentifiers | |
- name: Restore the application | |
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier | |
env: | |
Configuration: ${{ matrix.configuration }} | |
RuntimeIdentifier: win-${{ matrix.targetplatform }} | |
# Build main application | |
- name: Build the main application | |
run: msbuild $env:TargetApplicationDirectory/$env:TargetApplicationProjectFile /p:Platform=$env:TargetPlatform /p:Configuration=$env:Configuration | |
env: | |
Configuration: Release | |
TargetPlatform: ${{ matrix.targetplatform }} | |
# Build installer | |
- name: Build installer | |
run: msbuild $env:InsatllerApplicationDirectory/$env:InstallerApplicationProjectFile /p:Platform=$env:TargetPlatform /p:Configuration=$env:Configuration | |
env: | |
Configuration: Release | |
TargetPlatform: ${{ matrix.targetplatform }} | |
- name: Pack application into zip | |
uses: vimtor/[email protected] | |
with: | |
files: src/$env:TargetApplicationDirectory/bin/${{ matrix.targetplatform }}/${{ matrix.configuration }}/net6.0-windows/ | |
dest: src/$env:InsatllerApplicationDirectory/bin/${{ matrix.targetplatform }}/${{ matrix.configuration }}/net6.0-windows/$env:ZipPrefix-${{github.ref_name}}.zip | |
- name: Pack release with installer | |
uses: vimtor/[email protected] | |
with: | |
files: src/$env:InsatllerApplicationDirectory/bin/${{ matrix.targetplatform }}/${{ matrix.configuration }}/net6.0-windows/ | |
dest: src/$env:InsatllerApplicationDirectory/bin/${{ matrix.targetplatform }}/${{ matrix.configuration }}/net6.0-windows/$env:ZipInstaller-${{github.ref_name}}.zip | |
# Upload artifacts: https://github.com/marketplace/actions/upload-a-build-artifact | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.ArtifactName }} | |
path: src/$env:InsatllerApplicationDirectory/bin/${{ matrix.targetplatform }}/${{ matrix.configuration }}/net6.0-windows/$env:ZipInstaller-${{github.ref_name}}.zip |