mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-08 22:28:15 -05:00
update nuget action to require approval and set specific suffix depending on pr or push
This commit is contained in:
parent
63e1f31c21
commit
bcad270aaa
4
.github/workflows/build_application.yml
vendored
4
.github/workflows/build_application.yml
vendored
@ -14,6 +14,10 @@ on:
|
|||||||
branches: [ develop ]
|
branches: [ develop ]
|
||||||
paths:
|
paths:
|
||||||
- Application/**
|
- Application/**
|
||||||
|
- WebfrontCore/**
|
||||||
|
- Data/**
|
||||||
|
- SharedLibraryCore/**
|
||||||
|
- Plugins/**
|
||||||
|
|
||||||
env:
|
env:
|
||||||
releaseType: prerelease
|
releaseType: prerelease
|
||||||
|
44
.github/workflows/shared_library_nuget.yml
vendored
44
.github/workflows/shared_library_nuget.yml
vendored
@ -2,23 +2,23 @@ name: SharedLibraryCore NuGet
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ develop ]
|
branches: [ develop, release/pre, master ]
|
||||||
paths:
|
paths:
|
||||||
- SharedLibraryCore/**
|
- SharedLibraryCore/**
|
||||||
|
- Data/**
|
||||||
- .github/workflows/shared_library_nuget.yml
|
- .github/workflows/shared_library_nuget.yml
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ develop ]
|
branches: [ develop ]
|
||||||
paths:
|
paths:
|
||||||
- SharedLibraryCore/**
|
- SharedLibraryCore/**
|
||||||
|
- Data/**
|
||||||
|
|
||||||
env:
|
env:
|
||||||
outputDirectory: ${{ github.workspace}}/nuget
|
outputDirectory: ${{ github.workspace}}/nuget
|
||||||
buildConfiguration: Prerelease
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_pack:
|
make_version:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
build_num: ${{ steps.generate_build_number.outputs.build_num }}
|
build_num: ${{ steps.generate_build_number.outputs.build_num }}
|
||||||
|
|
||||||
@ -27,38 +27,56 @@ jobs:
|
|||||||
id: generate_build_number
|
id: generate_build_number
|
||||||
run: |
|
run: |
|
||||||
build_num=$(date +'%Y.%-m.%-d').$(date +'%3N' | sed 's/^0*//')
|
build_num=$(date +'%Y.%-m.%-d').$(date +'%3N' | sed 's/^0*//')
|
||||||
echo "build_num=$build_num" >> $GITHUB_ENV
|
|
||||||
echo "build_num=$build_num" >> $GITHUB_OUTPUT
|
echo "build_num=$build_num" >> $GITHUB_OUTPUT
|
||||||
|
echo "Build number is $build_num"
|
||||||
|
|
||||||
|
build_pack:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ make_version ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
buildNumber: ${{ needs.make_version.outputs.build_num }}
|
||||||
|
packageTag: ${{ github.event_name == 'pull_request' && -beta || -preview }}
|
||||||
|
buildConfiguration: Prerelease
|
||||||
|
|
||||||
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v4
|
||||||
with:
|
with:
|
||||||
dotnet-version: 8.0.x
|
dotnet-version: 8.0.x
|
||||||
|
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
run: dotnet restore
|
run: dotnet restore
|
||||||
- name: Build Data
|
|
||||||
run: dotnet build **/Data.csproj -c ${{env.buildConfiguration}} /p:Version=${{ env.build_num }} --no-restore
|
- name: Build data
|
||||||
|
run: dotnet build **/Data.csproj -c ${{env.buildConfiguration}} /p:Version=${{ env.buildNumber }} --no-restore
|
||||||
|
|
||||||
- name: Build SLC
|
- name: Build SLC
|
||||||
run: dotnet build **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} /p:Version=${{ env.build_num }} --no-restore
|
run: dotnet build **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} /p:Version=${{ env.buildNumber }} --no-restore
|
||||||
|
|
||||||
- name: Pack SLC
|
- name: Pack SLC
|
||||||
run: dotnet pack **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} -p:PackageVersion=${{ env.build_num }} -o ${{ env.outputDirectory }}
|
run: dotnet pack **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} -p:PackageVersion=${{ env.buildNumber }}${{ env.packageTag }} -o ${{ env.outputDirectory }} --no-restore
|
||||||
|
|
||||||
- name: Publish nuget package artifact
|
- name: Publish nuget package artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: SharedLibraryCore-${{ steps.generate_build_number.outputs.build_num }}
|
name: SharedLibraryCore-${{ env.buildNumber }}
|
||||||
path: ${{ env.outputDirectory }}/*.nupkg
|
path: ${{ env.outputDirectory }}/*.nupkg
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
needs: [ build_pack ]
|
needs: [ make_version, build_pack ]
|
||||||
|
environment: prerelease
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release/pre' || github.ref == 'refs/heads/release/develop' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download Artifact
|
- name: Download artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: SharedLibraryCore-${{ needs.build_pack.outputs.build_num }}
|
name: SharedLibraryCore-${{ needs.make_version.outputs.build_num }}
|
||||||
path: ${{ env.outputDirectory }}
|
path: ${{ env.outputDirectory }}
|
||||||
|
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
|
Loading…
x
Reference in New Issue
Block a user