mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
tap-new: add --github-packages
switch
This commit is contained in:
parent
27a76295a4
commit
56724da0b7
@ -24,6 +24,8 @@ module Homebrew
|
||||
flag "--branch=",
|
||||
description: "Initialize Git repository and setup GitHub Actions workflows with the " \
|
||||
"specified branch name (default: `main`)."
|
||||
switch "--github-packages",
|
||||
description: "Upload bottles to GitHub Packages."
|
||||
|
||||
named_args :tap, number: 1
|
||||
end
|
||||
@ -43,6 +45,17 @@ module Homebrew
|
||||
titleized_user[0] = titleized_user[0].upcase
|
||||
titleized_repo[0] = titleized_repo[0].upcase
|
||||
|
||||
pr_pull_env = {}
|
||||
pr_pull_env["HOMEBREW_GITHUB_API_TOKEN"] = "${{ github.token }}"
|
||||
pr_pull_env["PULL_REQUEST"] = "${{ github.event.pull_request.number }}"
|
||||
|
||||
if args.github_packages?
|
||||
pr_pull_env["HOMEBREW_GITHUB_PACKAGES_USER"] = "${{ github.actor }}"
|
||||
pr_pull_env["HOMEBREW_GITHUB_PACKAGES_TOKEN"] = "${{ github.token }}"
|
||||
|
||||
root_url = GitHubPackages.root_url(tap.user, "homebrew-#{tap.repo}")
|
||||
end
|
||||
|
||||
(tap.path/"Formula").mkpath
|
||||
|
||||
readme = <<~MARKDOWN
|
||||
@ -96,7 +109,7 @@ module Homebrew
|
||||
|
||||
- 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'
|
||||
|
||||
- name: Upload bottles as artifact
|
||||
@ -126,8 +139,7 @@ module Homebrew
|
||||
|
||||
- name: Pull bottles
|
||||
env:
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
|
||||
PULL_REQUEST: ${{ github.event.pull_request.number }}
|
||||
#{pr_pull_env.map { |k, v| "#{k}: #{v}" }.join "\n#{" " * 10}"}
|
||||
run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST
|
||||
|
||||
- name: Push commits
|
||||
|
Loading…
x
Reference in New Issue
Block a user