Merge pull request #12459 from FnControlOption/tap-new

tap-new: add `--github-packages` switch
This commit is contained in:
Mike McQuaid 2021-11-23 11:55:22 +00:00 committed by GitHub
commit 5c0d0effe3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,8 @@ module Homebrew
flag "--branch=", flag "--branch=",
description: "Initialize Git repository and setup GitHub Actions workflows with the " \ description: "Initialize Git repository and setup GitHub Actions workflows with the " \
"specified branch name (default: `main`)." "specified branch name (default: `main`)."
switch "--github-packages",
description: "Upload bottles to GitHub Packages."
named_args :tap, number: 1 named_args :tap, number: 1
end end
@ -42,6 +44,7 @@ module Homebrew
titleized_repo = tap.repo.dup titleized_repo = tap.repo.dup
titleized_user[0] = titleized_user[0].upcase titleized_user[0] = titleized_user[0].upcase
titleized_repo[0] = titleized_repo[0].upcase titleized_repo[0] = titleized_repo[0].upcase
root_url = GitHubPackages.root_url(tap.user, "homebrew-#{tap.repo}") if args.github_packages?
(tap.path/"Formula").mkpath (tap.path/"Formula").mkpath
@ -96,7 +99,7 @@ module Homebrew
- run: brew test-bot --only-tap-syntax - run: brew test-bot --only-tap-syntax
- run: brew test-bot --only-formulae - run: brew test-bot --only-formulae#{" --root-url=#{root_url}" if root_url}
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
- name: Upload bottles as artifact - name: Upload bottles as artifact
@ -127,6 +130,8 @@ module Homebrew
- name: Pull bottles - name: Pull bottles
env: env:
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }} HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }}
HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.actor }}
PULL_REQUEST: ${{ github.event.pull_request.number }} PULL_REQUEST: ${{ github.event.pull_request.number }}
run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST