Skip to content

Update dotnet-desktop.yml #25

Update dotnet-desktop.yml

Update dotnet-desktop.yml #25

Workflow file for this run

name: .NET Core Desktop
on:
push:
tags:
- "v.[0-9]+.[0-9]+.[0-9]+"
env:
VERSION: 1.0.0
SOLUTION_NAME: AdamServices.Utilities.QuickCode.sln # Replace with your solution name, i.e. MyWpfApp.sln.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT_PATH: c:/output/
jobs:
build:
#strategy:
# matrix:
# configuration: [Release]
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
steps:
- name: Checkout
uses: actions/checkout@v4
#with:
# fetch-depth: 0
- name: Set Version Variable
if: ${{ github.ref_type == 'tag' }}
env:
TAG: ${{ github.ref_name }}
run: |

Check failure on line 33 in .github/workflows/dotnet-desktop.yml

View workflow run for this annotation

GitHub Actions / .NET Core Desktop

Invalid workflow file

The workflow is not valid. .github/workflows/dotnet-desktop.yml (Line: 33, Col: 12): Unrecognized named-value: 'TAG'. Located at position 1 within expression: TAG
$VERSION = "${{ TAG }}" -replace '#v.#', ''
echo "${{ TAG }}"
echo "${{ VERSION }}"
#run: echo "VERSION=${TAG#v.#}" > $GITHUB_ENV
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:SOLUTION_NAME /t:Restore /p:OutDir=$env:OUTPUT_PATH /p:Configuration=Release
#env:
# Configuration: ${{ matrix.configuration }}
- name: Build the application
run: msbuild $env:SOLUTION_NAME /t:Build /p:OutDir=$env:OUTPUT_PATH /p:Configuration=Release
#env:
# Configuration: ${{ matrix.configuration }}
- name: Zip release
uses: TheDoctor0/zip-release@0.7.6
with:
# Filename for archive
filename: "QuickCode.portable.zip" # default is release.zip
# Base path for archive files
path: "${{ env.OUTPUT_PATH }}" # optional, default is .
# Working directory before zipping
#directory: "${{ env.OUTPUT_PATH }}" # optional, default is .
# List of excluded files / directories
#exclusions: # optional, default is
# List of excluded files / directories with recursive wildcards (only applies on Windows with `zip` type)
#recursive_exclusions: # optional, default is
# Provide any custom parameters to the zipping command
#custom: # optional, default is
# Tool to use for archiving
#type: # optional, default is zip
# An extra command that will run before zipping
#command: # optional, default is
- name: Publish Release
uses: "slord399/action-automatic-releases@v1.0.1"
with:
title: "Release v.${{ env.VERSION }}"
repo_token: "${{ env.GITHUB_TOKEN }}"
automatic_release_tag: "v.${{ env.VERSION }}"
prerelease: false
files: |
*.zip
# Decode the base 64 encoded pfx and save the Signing_Certificate
#- name: Decode the pfx
# run: |
# $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
# $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx
# [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
# Create the app package by building and packaging the Windows Application Packaging project
#- name: Create the app package
# run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
# env:
# Appx_Bundle: Always
# Appx_Bundle_Platforms: x86|x64
# Appx_Package_Build_Mode: StoreUpload
# Configuration: ${{ matrix.configuration }}
# Remove the pfx
#- name: Remove the pfx
# run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx
# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
#- name: Upload build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: MSIX Package
# path: ${{ env.Wap_Project_Directory }}\AppPackages