update nuget pipeline #12
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 Pack SharedLibraryCore Nuget | |
on: | |
push: | |
branches: [ "develop" ] | |
pull_request: | |
branches: [ "develop" ] | |
jobs: | |
build_pack: | |
runs-on: ubuntu-latest | |
env: | |
buildConfiguration: 'Prerelease' | |
steps: | |
- name: Make build number | |
id: generate_build_number | |
run: | | |
echo build_num=$(date +'%Y.%-m.%-d').$(( $(date +'%H') + $(date +'%M') + $(date +'%S') + $(date +'%3N') )) >> "$GITHUB_ENV" | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build Data | |
run: dotnet build **/Data.csproj -c ${{env.buildConfiguration}} /p:Version=${{ env.build_num }} --no-restore | |
- name: Build SLC | |
run: dotnet build **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} /p:Version=${{ env.build_num }} --no-restore | |
- name: Pack SLC | |
run: dotnet pack **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} -p:PackageVersion=${{ env.build_num }} | |
- name: Publish nuget package artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: SharedLibraryCore.${{ env.build_num }}.nupkg | |
path: '**/RaidMax.IW4MAdmin.SharedLibraryCore.${{ env.build_num }}.nupkg' |