Skip to content

Fix chocolatey upload #1103

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

Merged
merged 1 commit into from
Jun 2, 2025
Merged

Fix chocolatey upload #1103

merged 1 commit into from
Jun 2, 2025

Conversation

agateau-gg
Copy link
Collaborator

@agateau-gg agateau-gg commented May 30, 2025

Context

Automatic publication of the .nupkg file for Chocolatey failed during latest release. This PR fixes this.

Publication failed because there was no .nupkg file to publish:

Run scripts/chocolatey/push packages/ggshield.*.nupkg
  scripts/chocolatey/push packages/ggshield.*.nupkg
  shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
  env:
    CHOCOLATEY_API_KEY: ***
Chocolatey v2.4.3
File specified is either not found or not a .nupkg file. 'packages/ggshield.*.nupkg'

This was caused by the previous job step not downloading anything:

Run actions/download-artifact@v4
  with:
    pattern: ggshield.*.nupkg
    path: packages
    merge-multiple: false
    repository: GitGuardian/ggshield
    run-id: 15270372213
Found 5 artifact(s)
Filtering artifacts by pattern 'ggshield.*.nupkg'
Total of 0 artifact(s) downloaded
Download artifact has finished successfully

What has been done

There were 2 problems:

  1. the pattern in download-artifact must match the GitHub-generated artifact names, here os-packages-windows-2022.zip
  2. we must set merge-multiple to true otherwise the generated tree looks like this:
    packages
      os-packages-windows-2022
        ggshield-*-x86_64-pc-windows-msvc.zip
        ggshield.*.nupkg
    

Validation

I made a similar test commit that added a fake publish job to the ci.yml workflow: the job passed.

PR check list

  • As much as possible, the changes include tests (unit and/or functional)
  • If the changes affect the end user (new feature, behavior change, bug fix) then the PR has a changelog entry (see doc/dev/getting-started.md). If the changes do not affect the end user, then the skip-changelog label has been added to the PR.

Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.90%. Comparing base (9a6a393) to head (812be62).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1103   +/-   ##
=======================================
  Coverage   91.90%   91.90%           
=======================================
  Files         144      144           
  Lines        6091     6091           
=======================================
  Hits         5598     5598           
  Misses        493      493           
Flag Coverage Δ
unittests 91.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@agateau-gg agateau-gg force-pushed the agateau/fix-chocolatey-upload branch 3 times, most recently from 6e77914 to 3528ffb Compare May 30, 2025 14:34
Make sure the .nupkg file arrives in the `packages` dir.
@agateau-gg agateau-gg force-pushed the agateau/fix-chocolatey-upload branch from 3528ffb to 812be62 Compare May 30, 2025 14:53
@agateau-gg agateau-gg changed the title Agateau/fix chocolatey upload Fix chocolatey upload May 30, 2025
@agateau-gg agateau-gg marked this pull request as ready for review May 30, 2025 15:08
@agateau-gg agateau-gg requested a review from a team as a code owner May 30, 2025 15:08
@agateau-gg agateau-gg merged commit 942a546 into main Jun 2, 2025
29 of 30 checks passed
@agateau-gg agateau-gg deleted the agateau/fix-chocolatey-upload branch June 2, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants