Skip to content

Commit 76cc281

Browse files
Update publish_new.yml
1 parent 51f2d10 commit 76cc281

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

.github/workflows/publish_new.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
inputs:
66
build_configuration:
77
description: 'Build configuration'
8-
required: false
8+
required: true
99
type: string
1010
default: 'Release'
1111
secrets:
@@ -17,25 +17,14 @@ env:
1717
SOLUTION_NAME: ${{ vars.SOLUTION_NAME }}
1818
DOTNET_VERSION: '9.0.x'
1919
NUGET_SOURCE: 'https://api.nuget.org/v3/index.json'
20-
BUILD_CONFIGURATION: ''
2120

2221
jobs:
2322
build-publish:
2423
runs-on: ubuntu-latest
2524

2625
steps:
27-
- name: Release Configuration
28-
if: ${{ env.BRANCH_NAME == 'main' && (github.event.release.prerelease == false || github.event_name == 'workflow_dispatch') }}
29-
run: |
30-
echo "BUILD_CONFIGURATION=Release" >> $GITHUB_ENV
31-
32-
- name: Debug Configuration
33-
if: ${{ github.event.release.prerelease }}
34-
run: |
35-
echo "BUILD_CONFIGURATION=Debug" >> $GITHUB_ENV
36-
3726
- name: Check Build Configuration
38-
if: ${{ env.BUILD_CONFIGURATION == '' }}
27+
if: ${{ inputs.build_configuration == '' }}
3928
run: |
4029
echo "Invalid Build Configuration"
4130
exit 1
@@ -75,10 +64,10 @@ jobs:
7564
run: dotnet restore ${{ env.SOLUTION_NAME }}
7665

7766
- name: Build
78-
run: dotnet build --no-restore --configuration ${{ env.BUILD_CONFIGURATION }} ${{ env.SOLUTION_NAME }}
67+
run: dotnet build --no-restore --configuration ${{ inputs.build_configuration }} ${{ env.SOLUTION_NAME }}
7968

8069
- name: Test
81-
run: dotnet test --no-build --verbosity normal --configuration ${{ env.BUILD_CONFIGURATION }} ${{ env.SOLUTION_NAME }}
70+
run: dotnet test --no-build --verbosity normal --configuration ${{ inputs.build_configuration }} ${{ env.SOLUTION_NAME }}
8271

8372
- name: Pack and Push
84-
run: dotnet pack --no-build --configuration ${{ env.BUILD_CONFIGURATION }} -p:PackageOutputPath=../../output --version-suffix "${{ env.VERSION_SUFFIX }}" -p:PackageSource='${{ env.NUGET_SOURCE }}' -p:PushAfterPack=true -p:PackageApiKey='${{ secrets.NUGET_API_KEY }}'
73+
run: dotnet pack --no-build --configuration ${{inputs.build_configuration }} -p:PackageOutputPath=../../output --version-suffix "${{ env.VERSION_SUFFIX }}" -p:PackageSource='${{ env.NUGET_SOURCE }}' -p:PushAfterPack=true -p:PackageApiKey='${{ secrets.NUGET_API_KEY }}'

0 commit comments

Comments
 (0)