-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added build dlls and push to packages
- Loading branch information
Showing
2 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
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 }} |
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