Skip to content

Commit 4efada7

Browse files
committedDec 21, 2022
Update release-it.json and create-homebrew-tap-pr.sh
1 parent 16271cd commit 4efada7

File tree

3 files changed

+32
-13
lines changed

3 files changed

+32
-13
lines changed
 

‎.release-it.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"release": true,
44
"assets": "brew-distribution/*.zip"
55
},
6-
"buildCommand": "yarn package",
6+
"buildCommand": "yarn package:x64; yarn package:arm64",
77
"hooks": {
88
"before:bump": "yarn declarations; yarn build:schemas",
9-
"after:bump": "yarn package",
9+
"after:bump": "yarn package:x64; yarn package:arm64",
1010
"after:release": "VERSION=${version} scripts/create-homebrew-tap-pr.sh"
1111
}
1212
}

‎CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Following [this commit](https://github.com/danger/danger-js/commit/a26ac3b3bd4f0
4040
- Modify `changelog.md`, adding a new `### 0.21.0` heading under the `### Main` heading at the top of the file.
4141
- Commit both changes with the commit message **Version bump**.
4242
- Tag this commit - `git tag 0.21.0`.
43-
- Push the commit and tag to master - `git push origin main --follow-tags`. Travis CI will build the tagged commit and
44-
publish that tagged version to NPM.
43+
- Push the commit and tag to master - `git push origin main --follow-tags`. GitHub Actions will build the tagged commit
44+
and publish that tagged version to NPM.
4545

4646
:ship:
4747

‎scripts/create-homebrew-tap-pr.sh

+28-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22

33
[ -z ${VERSION+x} ] && { echo "VERSION is missing"; exit 1; }
44

5-
FILE=brew-distribution/danger-macos.zip
5+
FILE_X64=brew-distribution/danger-macos-x64.zip
6+
FILE_ARM64=brew-distribution/danger-macos-arm64.zip
67

7-
if [ ! -f ${FILE} ]; then
8-
echo ${FILE} not found!
8+
if [ ! -f ${FILE_X64} ]; then
9+
echo ${FILE_X64} not found!
10+
exit 1
11+
fi
12+
if [ ! -f ${FILE_ARM64} ]; then
13+
echo ${FILE_ARM64} not found!
914
exit 1
1015
fi
1116

12-
SHA=$(shasum -a 256 ${FILE} | cut -f 1 -d " ")
13-
echo "$SHA"
17+
SHA_X64=$(shasum -a 256 ${FILE_X64} | cut -f 1 -d " ")
18+
echo "SHA_X64=$SHA_X64"
19+
SHA_ARM64=$(shasum -a 256 ${FILE_ARM64} | cut -f 1 -d " ")
20+
echo "SHA_ARM64=$SHA_ARM64"
1421

1522
# Clone tap repo
1623
HOMEBREW_TAP_TMPDIR=$(mktemp -d)
@@ -23,11 +30,23 @@ cd "$HOMEBREW_TAP_TMPDIR" || exit 1
2330
# Write formula
2431
echo "class DangerJs < Formula" > danger-js.rb
2532
echo " homepage \"https://github.com/danger/danger-js\"" >> danger-js.rb
26-
echo " url \"https://github.com/danger/danger-js/releases/download/${VERSION}/danger-macos.zip\"" >> danger-js.rb
27-
echo " sha256 \"${SHA}\"" >> danger-js.rb
2833
echo >> danger-js.rb
29-
echo " def install" >> danger-js.rb
30-
echo " bin.install \"danger\"" >> danger-js.rb
34+
echo " if Hardware::CPU.intel?" >> danger-js.rb
35+
echo " url \"https://github.com/danger/danger-js/releases/download/${VERSION}/danger-macos-x64.zip\"" >> danger-js.rb
36+
echo " sha256 \"${SHA_X64}\"" >> danger-js.rb
37+
echo >> danger-js.rb
38+
echo " def install" >> danger-js.rb
39+
echo " bin.install \"danger-x64\" => \"danger\"" >> danger-js.rb
40+
echo " end" >> danger-js.rb
41+
echo " end" >> danger-js.rb
42+
echo >> danger-js.rb
43+
echo " if Hardware::CPU.arm?" >> danger-js.rb
44+
echo " url \"https://github.com/danger/danger-js/releases/download/${VERSION}/danger-macos-arm64.zip\"" >> danger-js.rb
45+
echo " sha256 \"${SHA_ARM64}\"" >> danger-js.rb
46+
echo >> danger-js.rb
47+
echo " def install" >> danger-js.rb
48+
echo " bin.install \"danger-arm64\" => \"danger\"" >> danger-js.rb
49+
echo " end" >> danger-js.rb
3150
echo " end" >> danger-js.rb
3251
echo "end" >> danger-js.rb
3352

0 commit comments

Comments
 (0)
Please sign in to comment.