Skip to content

Added build dlls and push to packages #2

Added build dlls and push to packages

Added build dlls and push to packages #2

Workflow file for this run

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-riptide-message-extensions\castledice-riptide-message-extensions.csproj
- name: Build DLLs
run: dotnet build -c Release
- name: Pack NuGet package
run: dotnet pack .\castledice-riptide-message-extensions\castledice-riptide-message-extensions.csproj -c Release /p:PackageVersion=${{ env.VERSION }}
- name: Publish DLLs to GitHub Packages
run: dotnet nuget push D:\a\castledice-riptide-message-extensions\castledice-riptide-message-extensions\castledice-riptide-message-extensions\bin\Release\castledice-riptide-message-extensions.${{ env.VERSION }}.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ secrets.GH_PAT_PACK }}