Skip to content

Commit

Permalink
refactor(dotnet): consistent envvar names
Browse files Browse the repository at this point in the history
.NET related environment variables should be prefixed `DOTNET_`.
  • Loading branch information
hknutsen committed Feb 12, 2025
1 parent c8c4f1e commit 491c782
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ jobs:
contents: read # Required to checkout the repository

env:
PROJECT: ${{ inputs.project }}
CONFIGURATION: Release
RUNTIME: ${{ inputs.runtime }}
SELF_CONTAINED: ${{ inputs.self_contained }}
DOTNET_PROJECT: ${{ inputs.project }}
DOTNET_CONFIGURATION: Release
DOTNET_RUNTIME: ${{ inputs.runtime }}
DOTNET_SELF_CONTAINED: ${{ inputs.self_contained }}

steps:
- name: Checkout
Expand All @@ -104,30 +104,30 @@ jobs:

# Restore dependencies for the application and runtime.
- name: .NET Restore
run: dotnet restore "$PROJECT" --runtime "$RUNTIME"
run: dotnet restore "$DOTNET_PROJECT" --runtime "$DOTNET_RUNTIME"

# Build the application for release/deployment.
- name: .NET Build
run: dotnet build "$PROJECT" --configuration "$CONFIGURATION" --runtime "$RUNTIME" --self-contained "$SELF_CONTAINED" --no-restore
run: dotnet build "$DOTNET_PROJECT" --configuration "$DOTNET_CONFIGURATION" --runtime "$DOTNET_RUNTIME" --self-contained "$DOTNET_SELF_CONTAINED" --no-restore

# Execute unit tests.
- name: .NET Test
if: inputs.test_project != ''
env:
PROJECT: ${{ inputs.test_project }}
COLLECT: ${{ inputs.test_collect }}
DOTNET_TEST_PROJECT: ${{ inputs.test_project }}
DOTNET_TEST_COLLECT: ${{ inputs.test_collect }}
run: |
while read -r proj; do
dotnet test "$proj" --configuration "$CONFIGURATION" --collect "$COLLECT"
done <<< "$PROJECT"
while read -r project; do
dotnet test "$project" --configuration "$DOTNET_CONFIGURATION" --collect "$DOTNET_TEST_COLLECT"
done <<< "$DOTNET_TEST_PROJECT"
# Publish the application and its dependencies to a folder for deployment.
- name: .NET Publish
id: publish
env:
OUTPUT: ${{ runner.temp }}/${{ inputs.artifact_name }}
run: |
dotnet publish "$PROJECT" --configuration "$CONFIGURATION" --runtime "$RUNTIME" --self-contained "$SELF_CONTAINED" --output "$OUTPUT" --no-build
dotnet publish "$DOTNET_PROJECT" --configuration "$DOTNET_CONFIGURATION" --runtime "$DOTNET_RUNTIME" --self-contained "$DOTNET_SELF_CONTAINED" --output "$OUTPUT" --no-build
echo "publish_path=$OUTPUT" >> "$GITHUB_OUTPUT"
- name: Create tarball
Expand Down

0 comments on commit 491c782

Please sign in to comment.