Update sorbet and sorbet-runtime together.

This commit is contained in:
Markus Reiter 2020-11-21 04:12:33 +01:00
parent 31adc607b8
commit 49b95da14b
3 changed files with 24 additions and 18 deletions

View File

@ -16,3 +16,5 @@ updates:
directory: /Library/Homebrew directory: /Library/Homebrew
schedule: schedule:
interval: daily interval: daily
ignore:
- dependency-name: sorbet-runtime

View File

@ -27,26 +27,29 @@ jobs:
with: with:
username: BrewTestBot username: BrewTestBot
- name: Check out pull request - name: Check out pull request
id: checkout_pull_request id: checkout
run: | run: |
gh pr checkout '${{ github.event.pull_request.number || github.event.inputs.pull_request }}' gh pr checkout '${{ github.event.pull_request.number || github.event.inputs.pull_request }}'
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
- name: Vendor Gems
id: vendor
run: |
brew vendor-gems
- name: Update RBI files
id: update
run: |
branch="$(git branch --show-current)" branch="$(git branch --show-current)"
echo "::set-output name=branch::${branch}" echo "::set-output name=branch::${branch}"
gem_name="$(echo "${branch}" | sed -E 's|.*/||;s|(.*)-.*$|\1|')"
echo "::set-output name=gem_name::${gem_name}"
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
- name: Vendor Gems
run: |
if [[ '${{ steps.checkout.outputs.gem_name }}' == 'sorbet' ]]; then
brew vendor-gems --update sorbet,sorbet-runtime
else
brew vendor-gems
fi
- name: Update RBI files
run: |
if brew typecheck --update --fail-if-not-changed; then if brew typecheck --update --fail-if-not-changed; then
gem_name="$(echo "${branch}" | sed -E 's|.*/||;s|(.*)-.*$|\1|')"
if git add Library/Homebrew/sorbet; then if git add Library/Homebrew/sorbet; then
git commit -m "Update RBI files for ${gem_name}." git commit -m "Update RBI files for ${{ steps.checkout.outputs.gem_name }}."
fi fi
git reset --hard git reset --hard
@ -55,5 +58,5 @@ jobs:
uses: Homebrew/actions/git-try-push@master uses: Homebrew/actions/git-try-push@master
with: with:
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
branch: ${{ steps.update.outputs.branch }} branch: ${{ steps.checkout.outputs.branch }}
force: true force: true

View File

@ -18,13 +18,14 @@ module Homebrew
Install and commit Homebrew's vendored gems. Install and commit Homebrew's vendored gems.
EOS EOS
switch "--update", comma_array "--update",
description: "Update all vendored Gems to the latest version." description: "Update all vendored Gems to the latest version."
max_named 0 max_named 0
end end
end end
sig { void }
def vendor_gems def vendor_gems
args = vendor_gems_args.parse args = vendor_gems_args.parse
@ -32,9 +33,9 @@ module Homebrew
ohai "cd #{HOMEBREW_LIBRARY_PATH}" ohai "cd #{HOMEBREW_LIBRARY_PATH}"
HOMEBREW_LIBRARY_PATH.cd do HOMEBREW_LIBRARY_PATH.cd do
if args.update? if args.update
ohai "bundle update" ohai "bundle update"
safe_system "bundle", "update" safe_system "bundle", "update", *args.update
ohai "git add Gemfile.lock" ohai "git add Gemfile.lock"
system "git", "add", "Gemfile.lock" system "git", "add", "Gemfile.lock"