File tree 8 files changed +119
-35
lines changed
8 files changed +119
-35
lines changed Original file line number Diff line number Diff line change
1
+ name : Brew Tap
2
+
3
+ inputs :
4
+ HOMEBREW_GITHUB_API_TOKEN :
5
+ description : ' Homebrew GitHub API Token'
6
+ required : true
7
+
8
+ runs :
9
+ using : ' composite'
10
+
11
+ steps :
12
+ - name : Add Tap
13
+ env :
14
+ HOMEBREW_GITHUB_API_TOKEN : ${{ inputs.HOMEBREW_GITHUB_API_TOKEN }}
15
+ shell : bash
16
+ run : |
17
+ brew tap brewforge/chinese
18
+ brew update
19
+
20
+ - name : Install Homebrew's dependencies
21
+ shell : bash
22
+ run : |
23
+ brew install ripgrep sd gcc parallel coreutils
24
+ brew unlink coreutils && brew link coreutils
25
+ brew install-bundler-gems --groups "audit,style"
26
+
27
+ - uses : oleksiyrudenko/gha-git-credentials@v2-latest
28
+ with :
29
+ global : true
30
+ name : ' Brewforge-Bot'
31
+
32
+ token : ' ${{ inputs.HOMEBREW_GITHUB_API_TOKEN }}'
33
+
34
+ - name : show git context
35
+ shell : bash
36
+ run : |
37
+ cat $HOME/.gitconfig
38
+ cat $GITHUB_ENV
Original file line number Diff line number Diff line change 12
12
- name : Bump outdated casks
13
13
# continue-on-error: true
14
14
env :
15
+ HOMEBREW_DEVELOPER : ' 1'
15
16
HOMEBREW_GITHUB_API_TOKEN : ${{ inputs.HOMEBREW_GITHUB_API_TOKEN }}
16
17
shell : bash
18
+ # https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-authenticated-users
19
+ # Github Actions: 5000 requests per hour
20
+ # 1 * 60 * 24 = 1440 (because bump-pr will checkout a new branch and push to remote)
21
+ # 1 concurrent parallel jobs, 1 second delay between jobs.
17
22
run : |
18
- parallel -j0 --group --halt now,fail=1 \
19
- ' ./.github/actions/bump-casks/script.sh {}' \
23
+ parallel -j1 --delay 1s --group --halt now,fail=1 \
24
+ " ./.github/actions/bump-casks/script.sh {}" \
20
25
::: $(ls $(brew --repository brewforge/chinese)/Casks/*.rb | xargs -I {} basename {} .rb)
Original file line number Diff line number Diff line change @@ -27,6 +27,6 @@ toV=${cleanCheck#*==>}
27
27
28
28
echo " Updating $cask from $fromV to $toV "
29
29
if [[ " $fromV " != " $toV " ]]; then
30
- brew bump-cask-pr " $cask " --version " $toV " --verbose --force
30
+ brew bump-cask-pr " $cask " --version " $toV " --verbose --force --fork-org Brewforge-Bot
31
31
fi
32
32
echo " Done for $cask "
Original file line number Diff line number Diff line change 12
12
- name : Bump outdated formulas
13
13
# continue-on-error: true
14
14
env :
15
+ HOMEBREW_DEVELOPER : ' 1'
15
16
HOMEBREW_GITHUB_API_TOKEN : ${{ inputs.HOMEBREW_GITHUB_API_TOKEN }}
16
17
shell : bash
18
+ # https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-authenticated-users
19
+ # Github Actions: 5000 requests per hour
20
+ # 1 * 60 * 24 = 1440 (because bump-pr will checkout a new branch and push to remote)
21
+ # 1 concurrent parallel jobs, 1 second delay between jobs.
17
22
run : |
18
- parallel -j0 --group --halt now,fail=1 \
19
- ' ./.github/actions/bump-formulas/script.sh {}' \
23
+ parallel -j1 --delay 1s --group --halt now,fail=1 \
24
+ " ./.github/actions/bump-formulas/script.sh {}" \
20
25
::: $(ls $(brew --repository brewforge/chinese)/Formula/*.rb | xargs -I {} basename {} .rb)
Original file line number Diff line number Diff line change @@ -27,6 +27,6 @@ toV=${cleanCheck#*==>}
27
27
28
28
echo " Updating $formula from $fromV to $toV "
29
29
if [[ " $fromV " != " $toV " ]]; then
30
- brew bump-formula-pr " $formula " --version " $toV " --verbose --force
30
+ brew bump-formula-pr " $formula " --version " $toV " --verbose --force --fork-org Brewforge-Bot
31
31
fi
32
32
echo " Done for $formula "
Original file line number Diff line number Diff line change 1
1
name : Homebrew Action
2
2
3
- inputs :
4
- HOMEBREW_GITHUB_API_TOKEN :
5
- description : ' Homebrew GitHub API Token'
6
- required : true
7
-
8
3
runs :
9
4
using : ' composite'
10
5
11
6
steps :
12
7
- name : Set up Homebrew
13
- id : set-up-homebrew
14
- uses : Homebrew/actions/setup-homebrew@master
15
- with :
16
- core : true
17
- cask : true
18
- test-bot : false
19
-
20
- - name : Add parallel cli
21
8
shell : bash
22
9
run : |
23
- brew install parallel
24
- # makesure brew livecheck works
25
- brew livecheck parallel
10
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
26
11
27
- - name : Add Tap
28
- env :
29
- HOMEBREW_GITHUB_API_TOKEN : ${{ inputs.HOMEBREW_GITHUB_API_TOKEN }}
12
+ - name : Add Homebrew to PATH
30
13
shell : bash
31
14
run : |
32
- brew tap brewforge/chinese
33
- brew update
34
- brew install ripgrep sd
15
+ touch $HOME/.bash_profile
16
+ (echo; echo 'eval "$(/usr/local/bin/ brew shellenv)"') >> $HOME/.bash_profile
17
+ eval "$(/usr/local/bin/ brew shellenv)"
Original file line number Diff line number Diff line change
1
+ name : Linuxbrew Action
2
+
3
+ runs :
4
+ using : ' composite'
5
+
6
+ steps :
7
+ - name : Set up Linuxbrew
8
+ shell : bash
9
+ run : |
10
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
11
+
12
+ - name : Add Linuxbrew to PATH
13
+ shell : bash
14
+ run : |
15
+ touch $HOME/.bashrc
16
+ (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> $HOME/.bashrc
17
+ eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
18
+
19
+ - name : Install Homebrew's dependencies
20
+ shell : bash
21
+ run : |
22
+ sudo apt-get install build-essential
Original file line number Diff line number Diff line change 1
- name : CI
1
+ name : schedule
2
2
3
3
on :
4
- pull_request :
5
- branches : [main, bump-* ]
4
+ # pull_request:
5
+ # branches: [main]
6
6
push :
7
7
branches : [fix-*]
8
8
schedule :
11
11
# Every day at 6am
12
12
- cron : " 0 6 * * *"
13
13
# allow run manually
14
- workflow_dispatch : {}
14
+ workflow_dispatch :
15
+
16
+ permissions : write-all
15
17
16
18
jobs :
17
19
casks :
@@ -24,11 +26,13 @@ jobs:
24
26
os : [macos-latest]
25
27
26
28
steps :
27
- # checkout myself.
28
29
- uses : actions/checkout@v3
29
30
30
31
- name : Homebrew env
31
32
uses : ./.github/actions/homebrew-env
33
+
34
+ - name : Brew Tap
35
+ uses : ./.github/actions/brew-tap
32
36
with :
33
37
HOMEBREW_GITHUB_API_TOKEN : ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
34
38
@@ -44,14 +48,41 @@ jobs:
44
48
45
49
strategy :
46
50
matrix :
47
- os : [macos-latest, ubuntu-latest ]
51
+ os : [macos-latest]
48
52
49
53
steps :
50
- # checkout myself.
51
54
- uses : actions/checkout@v3
52
55
53
56
- name : Homebrew env
54
57
uses : ./.github/actions/homebrew-env
58
+
59
+ - name : Brew Tap
60
+ uses : ./.github/actions/brew-tap
61
+ with :
62
+ HOMEBREW_GITHUB_API_TOKEN : ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
63
+
64
+ - name : Bump formulas
65
+ uses : ./.github/actions/bump-formulas
66
+ with :
67
+ HOMEBREW_GITHUB_API_TOKEN : ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
68
+
69
+ formulas-linuxbrew :
70
+ name : Bump Formulas in parallel (Linuxbrew)
71
+ if : github.repository == 'brewforge/homebrew-chinese'
72
+ runs-on : ${{ matrix.os }}
73
+
74
+ strategy :
75
+ matrix :
76
+ os : [ubuntu-latest]
77
+
78
+ steps :
79
+ - uses : actions/checkout@v3
80
+
81
+ - name : Homebrew env
82
+ uses : ./.github/actions/linuxbrew-env
83
+
84
+ - name : Brew Tap
85
+ uses : ./.github/actions/brew-tap
55
86
with :
56
87
HOMEBREW_GITHUB_API_TOKEN : ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
57
88
You can’t perform that action at this time.
0 commit comments