Skip to content

Update cd-build.yml #21

Update cd-build.yml

Update cd-build.yml #21

Workflow file for this run

name: cd-build
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4.1.4
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- name: 'Get Version'
id: version
run: |
$version = $env:GITHUB_REF -replace '^refs/tags/v', ''
Write-Host "Extracted version: $version"
echo "version=$version" >> $env:GITHUB_OUTPUT
- name: Build
run: |
msbuild /restore `
/t:Build,Pack src/WinUI.TableView.csproj `
/p:Configuration=Release `
/p:Version=${{ steps.version.outputs.version }} `
/p:PackageReleaseNotes="https://github.com/w-ahmad/WinUI.TableView/releases/tag/v${{ steps.version.outputs.version }}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet Packages
path: artifacts/NuGet/Release
- name: Push to NuGet
run: |
dotnet nuget push artifacts\NuGet\Release\*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate