Skip to content

Build upload artifact #11

Build upload artifact

Build upload artifact #11

Workflow file for this run

name: .NET Desktop build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
configuration: [Release] # configuration: [Debug, Release]
targetframework: [net48] # targetframework: [net48, , net8.0-windows]
runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
env:
Solution_Name: MTPCmd.sln # Replace with your solution name, i.e. MyWpfApp.sln.
Project_Directory: MTPCmd # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
Project_Name: MTPCmd\MTPCmd.csproj # Replace with the path to your Wap project, i.e. MyWpf.App\MyWpfApp.csproj.
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
# Execute all unit tests in the solution
#- name: Execute unit tests
# run: dotnet test
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
# Create the app package by building project
- name: Build and publish application
run: msbuild $env:Project_Path /t:Publish /p:Configuration=$env:Configuration /p:PublishDir=bin\Publish /p:TargetFramework=$env:TargetFramework
env:
Configuration: ${{ matrix.configuration }}
TargetFramework: ${{ matrix.targetframework }}
# Upload the build artifacts: https://github.com/marketplace/actions/upload-artifact
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: MTPCmd-package-${{ env:TargetFramework }}

Check failure on line 57 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .NET Desktop build

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 57, Col: 15): Unexpected symbol: 'env:TargetFramework'. Located at position 1 within expression: env:TargetFramework
path: ${{ env.Project_Directory }}\bin\Publish\
env:
TargetFramework: ${{ matrix.targetframework }}