Skip to content

Update publish.yml

Update publish.yml #3

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Publish
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: |
dotnet restore --packages .nuget --runtime win-x64
- name: Extract Assembly Version
id: extract-version
run: |
$csprojPath = (Get-ChildItem -Path . -Recurse -Filter *.csproj).FullName
$version = [xml](Get-Content $csprojPath) | Select-Xml -XPath "//PropertyGroup/AssemblyVersion" | ForEach-Object { $_.Node.InnerXml }
if (-not $version) {
$version = [xml](Get-Content $csprojPath) | Select-Xml -XPath "//PropertyGroup/Version" | ForEach-Object { $_.Node.InnerXml }
}
echo "##[set-output name=version;]$version"
shell: pwsh
- name: Display Assembly Version
run: echo "Assembly Version: ${{ steps.extract-version.outputs.version }}"

Check failure on line 34 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.yml

Invalid workflow file

You have an error in your yaml syntax on line 34
- name: Build
run: |
dotnet build --configuration Release --no-restore
- name: Publish
run: |
dotnet publish -c Release -r win-x64
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
# name: # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: ${{ github.workspace }}/bin/Release/net8.0/win-x64/publish/**/*
# The desired behavior if no files are found using the provided path.
# if-no-files-found: # optional, default is warn