Skip to content

Commit

Permalink
Added build dlls and push to packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Lackronik committed Dec 11, 2023
1 parent 443ed54 commit ecac056
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 9 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build_dlls.yml
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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@
</ItemGroup>

<ItemGroup>
<Reference Include="casltedice-events-logic">
<HintPath>..\..\casltedice-events-logic\casltedice-events-logic\bin\Debug\netstandard2.1\casltedice-events-logic.dll</HintPath>
</Reference>
<Reference Include="castledice-game-data-logic">
<HintPath>..\..\castledice-game-data-logic\castledice-game-data-logic\bin\Debug\netstandard2.1\castledice-game-data-logic.dll</HintPath>
</Reference>
<Reference Include="castledice-game-logic">
<HintPath>..\..\castledice-game-logic\castledice-game-logic\bin\Debug\netstandard2.1\castledice-game-logic.dll</HintPath>
</Reference>
<PackageReference Include="castledice-game-logic" Version="0.0.1-dev3" />
<PackageReference Include="castledice-game-data-logic" Version="0.0.1-dev2" />
<PackageReference Include="castledice-events-logic" Version="0.0.1-dev1" />
</ItemGroup>

</Project>

0 comments on commit ecac056

Please sign in to comment.