-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
add support for NUGET publishing actions #169
Conversation
**PublishNuget** - builds release and publishes nuget and symbol nuget for the current checked in version **PublishIncrementNuget** - Bumps incremental build number (11.2.X) - builds release and publishes nuget and symbol nuget for the - Checks in updated build number NOTE: This needs a NUGET_KEY secret added
📝 WalkthroughWalkthroughThe changes introduced in this pull request consist of two new GitHub Actions workflow files: The Similarly, the Both workflows are designed to streamline the build and publish processes for NuGet packages in .NET projects. 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: 7
🧹 Outside diff range and nitpick comments (3)
.github/workflows/PublishNuget.yml (2)
1-4
: Consider adding environment protection rulesWhile manual triggering provides control, consider adding environment protection rules to restrict who can trigger this workflow, especially since it involves publishing packages.
Add environment configuration:
on: workflow_dispatch: +environment: + name: production + rules: + - if: github.ref == 'refs/heads/main'
1-35
: Remove trailing spacesMultiple lines contain trailing spaces. While not critical, it's good practice to remove them for consistency.
You can use an editor command or sed to remove trailing spaces:
sed -i 's/[[:space:]]*$//' .github/workflows/PublishNuget.yml
🧰 Tools
🪛 actionlint (1.7.4)
14-14: the runner of "actions/setup-dotnet@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 yamllint (1.35.1)
[error] 10-10: trailing spaces
(trailing-spaces)
[error] 12-12: trailing spaces
(trailing-spaces)
[error] 17-17: trailing spaces
(trailing-spaces)
[error] 22-22: trailing spaces
(trailing-spaces)
[error] 23-23: trailing spaces
(trailing-spaces)
[error] 24-24: trailing spaces
(trailing-spaces)
[error] 32-32: trailing spaces
(trailing-spaces)
[error] 35-35: trailing spaces
(trailing-spaces)
.github/workflows/PublishIncrementalNuget.yml (1)
6-8
: Add workflow-level controlsConsider adding the following improvements:
- Concurrency control to prevent multiple version bumps
- Artifact retention for troubleshooting
Add these configurations at the workflow level:
jobs: + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true build: runs-on: ubuntu-latest + outputs: + nuget-package: ${{ steps.pack.outputs.package-path }}And after the pack step:
- name: Upload artifacts uses: actions/upload-artifact@v4 with: name: nuget-packages path: packages/ retention-days: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
.github/workflows/PublishIncrementalNuget.yml
(1 hunks).github/workflows/PublishNuget.yml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/PublishIncrementalNuget.yml
14-14: the runner of "actions/setup-dotnet@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
.github/workflows/PublishNuget.yml
14-14: the runner of "actions/setup-dotnet@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 yamllint (1.35.1)
.github/workflows/PublishIncrementalNuget.yml
[error] 10-10: trailing spaces
(trailing-spaces)
[error] 12-12: trailing spaces
(trailing-spaces)
[error] 17-17: trailing spaces
(trailing-spaces)
[error] 25-25: trailing spaces
(trailing-spaces)
[error] 30-30: trailing spaces
(trailing-spaces)
[error] 31-31: trailing spaces
(trailing-spaces)
[error] 32-32: trailing spaces
(trailing-spaces)
[error] 40-40: trailing spaces
(trailing-spaces)
[error] 43-43: trailing spaces
(trailing-spaces)
.github/workflows/PublishNuget.yml
[error] 10-10: trailing spaces
(trailing-spaces)
[error] 12-12: trailing spaces
(trailing-spaces)
[error] 17-17: trailing spaces
(trailing-spaces)
[error] 22-22: trailing spaces
(trailing-spaces)
[error] 23-23: trailing spaces
(trailing-spaces)
[error] 24-24: trailing spaces
(trailing-spaces)
[error] 32-32: trailing spaces
(trailing-spaces)
[error] 35-35: trailing spaces
(trailing-spaces)
🔇 Additional comments (1)
.github/workflows/PublishIncrementalNuget.yml (1)
22-24
: Verify project file targeting
The current glob pattern **/Consolonia.csproj
might match multiple project files if there are similarly named files in different directories. Consider using a more specific path.
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 8.0.x |
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.
Update setup-dotnet action version and consider pinning .NET version
The current setup has two potential improvements:
- The setup-dotnet action version is outdated
- The .NET version could be more specific to ensure reproducible builds
Apply this diff:
- uses: actions/setup-dotnet@v3
+ uses: actions/setup-dotnet@v4
with:
- dotnet-version: 8.0.x
+ dotnet-version: 8.0.100
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.100 |
🧰 Tools
🪛 actionlint (1.7.4)
14-14: the runner of "actions/setup-dotnet@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
- name: Commit new version changes | ||
run: | | ||
git config --global user.name "Github Action" | ||
git config --global user.email "[email protected]" | ||
git commit -a -m "Bumped version for published nuget artifacts" | ||
git push |
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.
🛠️ Refactor suggestion
Improve git configuration and error handling
Several improvements needed for the git operations:
- Use GitHub's default action bot email instead of hardcoding a user's email
- Add error handling for git operations
- Verify changes exist before committing
- name: Commit new version changes
run: |
git config --global user.name "Github Action"
- git config --global user.email "[email protected]"
+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ if [[ -n "$(git status --porcelain)" ]]; then
git commit -a -m "Bumped version for published nuget artifacts"
git push
+ else
+ echo "No changes to commit"
+ fi
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- name: Commit new version changes | |
run: | | |
git config --global user.name "Github Action" | |
git config --global user.email "[email protected]" | |
git commit -a -m "Bumped version for published nuget artifacts" | |
git push | |
- name: Commit new version changes | |
run: | | |
git config --global user.name "Github Action" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
if [[ -n "$(git status --porcelain)" ]]; then | |
git commit -a -m "Bumped version for published nuget artifacts" | |
git push | |
else | |
echo "No changes to commit" | |
fi |
for #167
PublishNuget
PublishIncrementNuget