Skip to content

Commit

Permalink
📦 Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kuleshov-aleksei committed Nov 11, 2023
1 parent c3da451 commit 7e17824
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ jobs:

env:
Solution_Path: Watermarker.sln
TargetApplication: Watermarker\Watermarker.csproj
InstallerApplication: Watermarker.Installer\Watermarker.Installer.csproj
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

- name: Use Nerdbank.GitVersioning to set version variables
uses: dotnet/nbgv@master
id: nbgv

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
Expand All @@ -45,13 +46,6 @@ jobs:
- name: Setup MSBuild.exe
uses: microsoft/[email protected]

# Update the version before build
#- name: Update manifest version
# run: |
# [xml]$manifest = get-content ".\$env:Wap_Project_Directory\Package.appxmanifest"
# $manifest.Package.Identity.Version = "${{ steps.nbgv.outputs.SimpleVersion }}.0"
# $manifest.save(".\$env:Wap_Project_Directory\Package.appxmanifest")

# 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
Expand All @@ -61,21 +55,33 @@ jobs:

# Build main application
- name: Build the main application
run: msbuild $env:TargetApplication /p:Platform=$env:TargetPlatform /p:Configuration=$env:Configuration
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:InstallerApplication /p:Platform=$env:TargetPlatform /p:Configuration=$env:Configuration
run: msbuild $env:InsatllerApplicationDirectory/$env:InstallerApplicationProjectFile /p:Platform=$env:TargetPlatform /p:Configuration=$env:Configuration
env:
Configuration: Release
TargetPlatform: ${{ matrix.targetplatform }}

# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
#- name: Upload build artifacts
# uses: actions/upload-artifact@v3
# with:
# name: MSIX Package
# path: src\${{ env.Wap_Project_Directory }}\${{ env.App_Packages_Directory }}
- 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

0 comments on commit 7e17824

Please sign in to comment.