Skip to content

Commit

Permalink
ci(package/api): Add dotnet_common_args to build and publish steps
Browse files Browse the repository at this point in the history
This commit adds the `dotnet_common_args` environment variable to the build and publish steps in the GitHub Actions workflow for building the package API. This variable is used to specify additional arguments for the `dotnet build` and `dotnet publish` commands, specifically `/p:IncludeSourceRevisionInInformationalVersion=false`.
  • Loading branch information
SakuraIsayeki committed Feb 17, 2024
1 parent de7e630 commit e5599ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-package-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ permissions:
contents: read
packages: read

env:
dotnet_common_args: |
/p:IncludeSourceRevisionInInformationalVersion=false
jobs:
# Build prod
build-api-prod:
Expand All @@ -29,10 +33,10 @@ jobs:
# include-prerelease: true

- name: Build .NET project (prod)
run: dotnet build ./WowsKarma.Api/WowsKarma.Api.csproj --configuration ${{ inputs.build_configuration }}
run: dotnet build ./WowsKarma.Api/WowsKarma.Api.csproj --configuration ${{ inputs.build_configuration }} ${{ env.dotnet_common_args }}

- name: Package API (prod)
run: dotnet publish ./WowsKarma.Api/WowsKarma.Api.csproj --configuration ${{ inputs.build_configuration }} --output ./publish
run: dotnet publish ./WowsKarma.Api/WowsKarma.Api.csproj --configuration ${{ inputs.build_configuration }} --output ./publish ${{ env.dotnet_common_args }}

- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit e5599ad

Please sign in to comment.