-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
272 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# ======================== | ||
# bump | ||
echo "> Running brew bump dry-run..." | ||
|
||
items=$(brew livecheck --tap brewforge/chinese --extract-plist --full-name --json || echo "[]") | ||
|
||
for item in $(echo "$items" | jq -r '.[] | .formula'); do | ||
if [ "$item" == "null" ]; then | ||
continue | ||
fi | ||
|
||
echo "---" # newline | ||
|
||
item_obj=$(echo "$items" | jq --arg item "$item" '.[] | select(.formula == $item)') | ||
|
||
is_formula=$(echo "$item_obj" | jq -r '.formula') | ||
|
||
item_status=$(echo "$item_obj" | jq -r '.status') | ||
item_version_current=$(echo "$item_obj" | jq -r '.version.current') | ||
item_version_latest=$(echo "$item_obj" | jq -r '.version.latest') | ||
item_outdated=$(echo "$item_obj" | jq -r '.version.outdated') | ||
item_newer=$(echo "$item_obj" | jq -r '.version.newer_than_upstream') | ||
|
||
if [ "$item_status" == "skipped" ]; then | ||
# skipped. | ||
echo -e "$item: \033[0;31m$(echo "$item_obj" | jq -r '.messages[0]')\033[0m" | ||
continue | ||
elif [ "$item_outdated" == "false" ]; then | ||
# up-to-date. | ||
echo -e "$item: \033[0;32mUp-to-date\033[0m" | ||
continue | ||
elif [ "$item_newer" == "true" ]; then | ||
# newer than upstream. | ||
echo -e "$item: \033[0;33mNewer than upstream\033[0m" | ||
continue | ||
fi | ||
|
||
# bump. | ||
echo "> Bumping $item from $item_version_current to $item_version_latest..." | ||
|
||
if [ "$item_version_latest" == "null" ]; then | ||
echo "$item_obj" | ||
|
||
if [ -n "$is_formula" ]; then | ||
cat "$(brew edit "$item" --print-path)" | ||
fi | ||
|
||
echo -e "\033[0;31m> Error: version.latest is null\033[0m" | ||
continue | ||
fi | ||
|
||
# ======================== | ||
# dry-run | ||
_BUMP_OPTIONS="--verbose" | ||
|
||
if [ "$is_formula" != "null" ]; then | ||
# is_formula. | ||
|
||
echo "* Running brew bump-formula-pr $item --version=$item_version_latest $_BUMP_OPTIONS..." | ||
brew bump-formula-pr "$item" --version="$item_version_latest" $_BUMP_OPTIONS | ||
# echo -e "\033[0;33m* TDOO: brew bump-formula-pr $item --version=$item_version_latest $_BUMP_OPTIONS\033[0m" | ||
fi | ||
|
||
echo "> Done for $item" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: bump-intel | ||
|
||
on: | ||
# pull_request: | ||
# branches: [main] | ||
# push: | ||
# branches: [fix-*] | ||
schedule: | ||
# Every 12 hours | ||
# - cron: "20 */12 * * *" | ||
# Every day at 6am | ||
- cron: "0 8 * * *" | ||
# allow run manually | ||
workflow_dispatch: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
bump-formulae: | ||
name: Bump formulae | ||
if: github.repository == 'brewforge/homebrew-chinese' | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-13] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Homebrew env | ||
uses: ./.github/actions/homebrew-env | ||
|
||
- name: Brew Tap | ||
uses: ./.github/actions/brew-tap | ||
|
||
- name: Git Cred | ||
uses: ./.github/actions/git-cred | ||
with: | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
|
||
- name: Bump | ||
env: | ||
HOMEBREW_DEVELOPER: "1" | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
shell: bash -ieo pipefail {0} | ||
run: | | ||
rsync -lrv --exclude=.git "$(pwd)" "$(brew --repository brewforge/chinese)" | ||
cd "$(brew --repository brewforge/chinese)" | ||
./.github/actions/bump-formulae/script.sh | ||
bump-formulae-linux: | ||
name: Bump formulae (Linuxbrew) | ||
if: github.repository == 'brewforge/homebrew-chinese' | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Linuxbrew env | ||
uses: ./.github/actions/linuxbrew-env | ||
|
||
- name: Brew Tap | ||
uses: ./.github/actions/brew-tap | ||
|
||
- name: Git Cred | ||
uses: ./.github/actions/git-cred | ||
with: | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
|
||
- name: Bump | ||
env: | ||
HOMEBREW_DEVELOPER: "1" | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
shell: bash -ieo pipefail {0} | ||
run: | | ||
rsync -lrv --exclude=.git "$(pwd)" "$(brew --repository brewforge/chinese)" | ||
cd "$(brew --repository brewforge/chinese)" | ||
./.github/actions/bump-formulae/script.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: bump | ||
|
||
on: | ||
# pull_request: | ||
# branches: [main] | ||
# push: | ||
# branches: [fix-*] | ||
schedule: | ||
# Every 12 hours | ||
# - cron: "20 */12 * * *" | ||
# Every day at 6am | ||
- cron: "0 6 * * *" | ||
# allow run manually | ||
workflow_dispatch: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
bump-casks: | ||
name: Bump casks | ||
if: github.repository == 'brewforge/homebrew-chinese' | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Homebrew env | ||
uses: ./.github/actions/homebrew-env | ||
|
||
- name: Brew Tap | ||
uses: ./.github/actions/brew-tap | ||
|
||
- name: Git Cred | ||
uses: ./.github/actions/git-cred | ||
with: | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
|
||
- name: Bump | ||
env: | ||
HOMEBREW_DEVELOPER: "1" | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
shell: bash -ieo pipefail {0} | ||
run: | | ||
rsync -lrv --exclude=.git "$(pwd)" "$(brew --repository brewforge/chinese)" | ||
cd "$(brew --repository brewforge/chinese)" | ||
./.github/actions/bump-casks/script.sh | ||
bump-formulae: | ||
name: Bump formulae | ||
if: github.repository == 'brewforge/homebrew-chinese' | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Homebrew env | ||
uses: ./.github/actions/homebrew-env | ||
|
||
- name: Brew Tap | ||
uses: ./.github/actions/brew-tap | ||
|
||
- name: Git Cred | ||
uses: ./.github/actions/git-cred | ||
with: | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
|
||
- name: Bump | ||
env: | ||
HOMEBREW_DEVELOPER: "1" | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
shell: bash -ieo pipefail {0} | ||
run: | | ||
rsync -lrv --exclude=.git "$(pwd)" "$(brew --repository brewforge/chinese)" | ||
cd "$(brew --repository brewforge/chinese)" | ||
./.github/actions/bump-formulae/script.sh | ||
bump-formulae-linux: | ||
name: Bump formulae (Linuxbrew) | ||
if: github.repository == 'brewforge/homebrew-chinese' | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Linuxbrew env | ||
uses: ./.github/actions/linuxbrew-env | ||
|
||
- name: Brew Tap | ||
uses: ./.github/actions/brew-tap | ||
|
||
- name: Git Cred | ||
uses: ./.github/actions/git-cred | ||
with: | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
|
||
- name: Bump | ||
env: | ||
HOMEBREW_DEVELOPER: "1" | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
shell: bash -ieo pipefail {0} | ||
run: | | ||
rsync -lrv --exclude=.git "$(pwd)" "$(brew --repository brewforge/chinese)" | ||
cd "$(brew --repository brewforge/chinese)" | ||
./.github/actions/bump-formulae/script.sh |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.