-
-
Notifications
You must be signed in to change notification settings - Fork 9
[github-nfbot] Fix publish path #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Use pack rather than build
WalkthroughThe pull request modifies the GitHub Actions workflow configuration for the NanoFramework GitHub Bot. The primary change is in the Azure Function build process, switching from Changes
Suggested labels
Suggested reviewers
Possibly related PRs
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
.github/workflows/NanoFramework-GitHubBot.yml (1)
35-37: Consider enhancing the workflow with best practicesWhile the change might fix the immediate issue, consider these improvements:
- Add a build verification step before packing
- Include package version control
- Add artifact retention for debugging
- name: Build and pack Azure Function run: | + # Build first to catch any compilation errors + dotnet build "github-nfbot/GitHub-nfbot" --configuration ${{ env.CONFIGURATION }} + + # Pack with version control dotnet pack "github-nfbot/GitHub-nfbot" --configuration ${{ env.CONFIGURATION }} --property:PackageOutputPath="${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}" + +- name: Upload artifact for debugging + uses: actions/upload-artifact@v3 + with: + name: function-package + path: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} + retention-days: 5
| - name: Build and pack Azure Function | ||
| run: | | ||
| dotnet build "github-nfbot/GitHub-nfbot" --configuration ${{ env.CONFIGURATION }} --property:PublishDir="${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}" | ||
| dotnet pack "github-nfbot/GitHub-nfbot" --configuration ${{ env.CONFIGURATION }} --property:PackageOutputPath="${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
The switch from dotnet build to dotnet pack is incorrect for Azure Functions deployment
The change from dotnet build to dotnet pack is problematic because:
- Azure Functions deployment expects a published output directory containing the function app files
dotnet packcreates a NuGet package which is not the correct format for Azure Functions deployment- The project is clearly an Azure Functions project (has
AzureFunctionsVersionproperty andMicrosoft.NET.Sdk.Functionspackage)
The correct command should be dotnet publish instead of dotnet pack. The workflow should be reverted to use dotnet publish with the appropriate output directory.
🔗 Analysis chain
Verify Azure Functions deployment compatibility with packed output
The switch from dotnet build to dotnet pack changes the output format. While this might fix your publish path issue, let's verify that Azure Functions deployment supports this package format.
Let me gather more information about the deployment step to understand how the packed output is being used.
Let me check the deployment step configuration to understand how the packed output is being used.
Let me check the project file and workflow file more specifically to understand the Azure Functions configuration.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the workflow has been successfully deployed with packed output
# Look for any recent discussions or issues about using dotnet pack with Azure Functions
# Search for related discussions in the repository
rg -i "dotnet pack.*azure function"
rg -i "packageoutputpath.*azure function"
# Check workflow run history
gh run list --workflow=NanoFramework-GitHubBot.yml --limit 5
Length of output: 979
Script:
#!/bin/bash
# Check the deployment step configuration and any recent changes
rg -A 10 "azure/functions-action" .github/workflows/NanoFramework-GitHubBot.yml
# Look for any configuration files that might affect the deployment
fd -e json -e csproj ".*" --exec cat {}
Length of output: 51625
Script:
#!/bin/bash
# Check the deployment step and its configuration
rg -B 5 -A 5 "azure/functions-action@v1" .github/workflows/NanoFramework-GitHubBot.yml
# Check if the project is configured as a function app
cat "github-nfbot/GitHub-nfbot/host.json"
Length of output: 153
Script:
#!/bin/bash
# Check the workflow file content
cat .github/workflows/NanoFramework-GitHubBot.yml
# Check the function project file
cat github-nfbot/GitHub-nfbot/GitHub-nfbot.csproj
Length of output: 2841
Description
Use pack rather than build.
Motivation and Context
Fails on last PR's
How Has This Been Tested?
Screenshots
Types of changes
Checklist:
Summary by CodeRabbit
dotnet buildtodotnet packfor packaging the Azure Function.