Skip to content

Commit

Permalink
Merge pull request #11010 from MikeMcQuaid/github_package_ci_upload_f…
Browse files Browse the repository at this point in the history
…ixes

GitHub Packages CI upload fixes
  • Loading branch information
MikeMcQuaid committed Apr 2, 2021
2 parents 8a7df0c + 0ec1f04 commit 3845684
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 12 deletions.
7 changes: 5 additions & 2 deletions Library/Homebrew/dev-cmd/pr-pull.rb
Expand Up @@ -22,10 +22,12 @@ def pr_pull_args
EOS
switch "--no-publish",
description: "Download the bottles, apply the bottle commit and "\
"upload the bottles to Bintray, but don't publish them."
"upload the bottles, but don't publish them."
switch "--no-upload",
description: "Download the bottles and apply the bottle commit, "\
"but don't upload to Bintray or GitHub Releases."
"but don't upload."
switch "--no-commit",
description: "Do not generate a new commit before uploading."
switch "-n", "--dry-run",
description: "Print what would be done rather than doing it."
switch "--clean",
Expand Down Expand Up @@ -431,6 +433,7 @@ def pr_pull
upload_args = ["pr-upload"]
upload_args << "--debug" if args.debug?
upload_args << "--verbose" if args.verbose?
upload_args << "--no-commit" if args.no_commit?
upload_args << "--no-publish" if args.no_publish?
upload_args << "--dry-run" if args.dry_run?
upload_args << "--keep-old" if args.keep_old?
Expand Down
6 changes: 5 additions & 1 deletion Library/Homebrew/github_packages.rb
Expand Up @@ -52,7 +52,11 @@ def upload_bottles(bottles_hash, dry_run:)
raise UsageError, "HOMEBREW_GITHUB_PACKAGES_USER is unset." if user.blank?
raise UsageError, "HOMEBREW_GITHUB_PACKAGES_TOKEN is unset." if token.blank?

skopeo = HOMEBREW_PREFIX/"bin/skopeo"
skopeo = [
which("skopeo"),
which("skopeo", ENV["HOMEBREW_PATH"]),
HOMEBREW_PREFIX/"bin/skopeo",
].compact.first
unless skopeo.exist?
ohai "Installing `skopeo` for upload..."
safe_system HOMEBREW_BREW_FILE, "install", "--formula", "skopeo"
Expand Down
1 change: 1 addition & 0 deletions completions/bash/brew
Expand Up @@ -1464,6 +1464,7 @@ _brew_pr_pull() {
--ignore-missing-artifacts
--keep-old
--message
--no-commit
--no-publish
--no-upload
--quiet
Expand Down
5 changes: 3 additions & 2 deletions completions/fish/brew.fish
Expand Up @@ -1058,8 +1058,9 @@ __fish_brew_complete_arg 'pr-pull' -l help -d 'Show this message'
__fish_brew_complete_arg 'pr-pull' -l ignore-missing-artifacts -d 'Comma-separated list of workflows which can be ignored if they have not been run'
__fish_brew_complete_arg 'pr-pull' -l keep-old -d 'If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL'
__fish_brew_complete_arg 'pr-pull' -l message -d 'Message to include when autosquashing revision bumps, deletions, and rebuilds'
__fish_brew_complete_arg 'pr-pull' -l no-publish -d 'Download the bottles, apply the bottle commit and upload the bottles to Bintray, but don\'t publish them'
__fish_brew_complete_arg 'pr-pull' -l no-upload -d 'Download the bottles and apply the bottle commit, but don\'t upload to Bintray or GitHub Releases'
__fish_brew_complete_arg 'pr-pull' -l no-commit -d 'Do not generate a new commit before uploading'
__fish_brew_complete_arg 'pr-pull' -l no-publish -d 'Download the bottles, apply the bottle commit and upload the bottles, but don\'t publish them'
__fish_brew_complete_arg 'pr-pull' -l no-upload -d 'Download the bottles and apply the bottle commit, but don\'t upload'
__fish_brew_complete_arg 'pr-pull' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'pr-pull' -l resolve -d 'When a patch fails to apply, leave in progress and allow user to resolve, instead of aborting'
__fish_brew_complete_arg 'pr-pull' -l root-url -d 'Use the specified URL as the root of the bottle\'s URL instead of Homebrew\'s default'
Expand Down
5 changes: 3 additions & 2 deletions completions/zsh/_brew
Expand Up @@ -1301,8 +1301,9 @@ _brew_pr_pull() {
'--ignore-missing-artifacts[Comma-separated list of workflows which can be ignored if they have not been run]' \
'--keep-old[If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL]' \
'--message[Message to include when autosquashing revision bumps, deletions, and rebuilds]' \
'--no-publish[Download the bottles, apply the bottle commit and upload the bottles to Bintray, but don'\''t publish them]' \
'--no-upload[Download the bottles and apply the bottle commit, but don'\''t upload to Bintray or GitHub Releases]' \
'--no-commit[Do not generate a new commit before uploading]' \
'--no-publish[Download the bottles, apply the bottle commit and upload the bottles, but don'\''t publish them]' \
'--no-upload[Download the bottles and apply the bottle commit, but don'\''t upload]' \
'--quiet[Make some output more quiet]' \
'--resolve[When a patch fails to apply, leave in progress and allow user to resolve, instead of aborting]' \
'--root-url[Use the specified URL as the root of the bottle'\''s URL instead of Homebrew'\''s default]' \
Expand Down
6 changes: 4 additions & 2 deletions docs/Manpage.md
Expand Up @@ -1168,9 +1168,11 @@ pull request with artifacts generated by GitHub Actions.
Requires write access to the repository.

* `--no-publish`:
Download the bottles, apply the bottle commit and upload the bottles to Bintray, but don't publish them.
Download the bottles, apply the bottle commit and upload the bottles, but don't publish them.
* `--no-upload`:
Download the bottles and apply the bottle commit, but don't upload to Bintray or GitHub Releases.
Download the bottles and apply the bottle commit, but don't upload.
* `--no-commit`:
Do not generate a new commit before uploading.
* `-n`, `--dry-run`:
Print what would be done rather than doing it.
* `--clean`:
Expand Down
10 changes: 7 additions & 3 deletions manpages/brew.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BREW" "1" "March 2021" "Homebrew" "brew"
.TH "BREW" "1" "April 2021" "Homebrew" "brew"
.
.SH "NAME"
\fBbrew\fR \- The Missing Package Manager for macOS (or Linux)
Expand Down Expand Up @@ -1622,11 +1622,15 @@ Download and publish bottles, and apply the bottle commit from a pull request wi
.
.TP
\fB\-\-no\-publish\fR
Download the bottles, apply the bottle commit and upload the bottles to Bintray, but don\'t publish them\.
Download the bottles, apply the bottle commit and upload the bottles, but don\'t publish them\.
.
.TP
\fB\-\-no\-upload\fR
Download the bottles and apply the bottle commit, but don\'t upload to Bintray or GitHub Releases\.
Download the bottles and apply the bottle commit, but don\'t upload\.
.
.TP
\fB\-\-no\-commit\fR
Do not generate a new commit before uploading\.
.
.TP
\fB\-n\fR, \fB\-\-dry\-run\fR
Expand Down

0 comments on commit 3845684

Please sign in to comment.