Update dependencies versions #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish DLLs | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build_and_publish: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.sha }} | |
- name: Extract version digits from tag | |
id: extract_version | |
run: | | |
$TAG="${{ github.ref_name }}" | |
if (-not ($TAG -match '^v\d+\.\d+\.\d+.*?$')) { | |
echo "Invalid tag format: $TAG" | |
exit 1 | |
} | |
$version=$TAG.Substring(1) | |
echo "VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Install .NET Core SDK | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: '8.0' | |
- name: Restore NuGet packages | |
run: | | |
dotnet nuget add source --username Lackronik --password ${{ secrets.GH_PAT_PACK }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
dotnet restore .\castledice-events-logic\castledice-events-logic.csproj | |
- name: Build DLLs | |
run: dotnet build --source .\castledice-events-logic\castledice-events-logic\castledice-events-logic -c Release | |
- name: Pack NuGet package | |
run: dotnet pack .\castledice-events-logic\castledice-events-logic.csproj -c Release /p:PackageVersion=${{ env.VERSION }} | |
- name: Publish DLLs to GitHub Packages | |
run: dotnet nuget push D:\a\castledice-events-logic\castledice-events-logic\castledice-events-logic\bin\Release\castledice-events-logic.${{ env.VERSION }}.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ secrets.GH_PAT_PACK }} |