Watch
2
0
Fork
You've already forked raylib-cs
0

set package version from Directory.Build.props

This commit is contained in:
anggape 2023-07-26 11:00:56 +07:00
commit f8db19ab20
No known key found for this signature in database
GPG key ID: 318EF680D0181D86
5 changed files with 15 additions and 10 deletions

View file

@ -22,8 +22,8 @@ jobs:
id: version
shell: bash
run: |
echo "version=$(sed -n 's/.*<TargetRaylibTag>\(.*\)<\/TargetRaylibTag>.*/\1/p' Raylib-cs/Raylib-cs.csproj)">> ${GITHUB_OUTPUT}
echo "pkgversion=$(sed -n 's/.*<PackageVersion>\(.*\)<\/PackageVersion>.*/\1/p' Raylib-cs/Raylib-cs.csproj)">> ${GITHUB_OUTPUT}
echo "version=$(sed -n 's/.*<TargetRaylibTag>\(.*\)<\/TargetRaylibTag>.*/\1/p' Directory.Build.props)">> ${GITHUB_OUTPUT}
echo "pkgversion=$(sed -n 's/.*<PackageVersion>\(.*\)<\/PackageVersion>.*/\1/p' Directory.Build.props)">> ${GITHUB_OUTPUT}
build-android:
runs-on: ubuntu-latest
@ -235,22 +235,22 @@ jobs:
dotnet-version: 6.0.x
- name: Create NuGet Package
run: dotnet pack -c Release Raylib-cs
run: dotnet pack -c Release -o artifacts/nupkg
- name: Upload NuGet Package As Artifact
uses: actions/upload-artifact@v3
with:
path: Raylib-cs/bin/Release/Raylib-cs.${{ needs.prepare.outputs.pkgversion }}.*pkg
path: artifacts/nupkg/Raylib-cs.*.*pkg
- name: Upload NuGet Package As Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: Raylib-cs/bin/Release/Raylib-cs.${{ needs.prepare.outputs.pkgversion }}.*pkg
files: artifacts/nupkg/Raylib-cs.*.*pkg
- name: Publish to NuGet
if: startsWith(github.ref, 'refs/tags/')
run: |
dotnet nuget push \
Raylib-cs/bin/Release/Raylib-cs.${{ needs.prepare.outputs.pkgversion }}.nupkg \
artifacts/nupkg/Raylib-cs.*.*pkg \
--api-key ${{secrets.NUGET_API_KEY}}

8
Directory.Build.props Normal file
View file

@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<TargetRaylibTag>4.5.0</TargetRaylibTag>
<PackageVersion>4.5.0.2-android.1</PackageVersion>
</PropertyGroup>
</Project>

View file

@ -10,6 +10,7 @@
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<EmbedAssembliesIntoApk Condition="$(Configuration) == 'Debug'">true</EmbedAssembliesIntoApk>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Raylib-cs" Version="4.5.0.2" />

View file

@ -6,7 +6,6 @@
<RootNamespace>Raylib_cs.Android</RootNamespace>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Raylibcs.Android</AssemblyName>
</PropertyGroup>
</Project>

View file

@ -11,9 +11,6 @@
</PropertyGroup>
<PropertyGroup>
<TargetRaylibTag>4.5.0</TargetRaylibTag>
<Version>4.5.0.2</Version>
<PackageVersion>4.5.0.2</PackageVersion>
<Authors>Chris Dill, Raysan5</Authors>
<PackProject>true</PackProject>
<IncludeSymbols>true</IncludeSymbols>