File tree 4 files changed +73
-6
lines changed
4 files changed +73
-6
lines changed Original file line number Diff line number Diff line change
1
+ name : Release executable files for macOS
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ version_digit :
7
+ description : ' Version digit (major | minor | patch)'
8
+ required : true
9
+ default : ' patch'
10
+ type : choice
11
+ options :
12
+ - major
13
+ - minor
14
+ - patch
15
+
16
+ jobs :
17
+ release :
18
+ runs-on : ubuntu-latest
19
+ env :
20
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
21
+ HOMEBREW_TAP_DEPLOY_SECRET_KEY : ${{ secrets.HOMEBREW_TAP_DEPLOY_SECRET_KEY }}
22
+ permissions : write-all
23
+ steps :
24
+ - name : Set up QEMU
25
+ uses : docker/setup-qemu-action@v2
26
+
27
+ - name : Install ldid
28
+ uses : MOZGIII/install-ldid-action@v1
29
+ with :
30
+ tag : v2.1.5-procursus6
31
+
32
+ - name : Check out repository code
33
+ uses : actions/checkout@v3
34
+
35
+ - name : Use node
36
+ uses : actions/setup-node@v3
37
+ with :
38
+ node-version : " 14"
39
+
40
+ - name : Install dependencies
41
+ run : npm install
42
+
43
+ - name : Build
44
+ run : npm run build
45
+
46
+ - name : Package
47
+ run : |
48
+ git config --global user.email "action@github.com"
49
+ git config --global user.name "GitHub Action"
50
+ npm run release -- ${{ github.event.inputs.version_digit }} --ci
51
+
52
+ - name : Update homebrew/tap repo for new release
53
+ shell : bash
54
+ run : scripts/create-homebrew-tap-pr.sh
55
+ env :
56
+ VERSION : ${{ env.VERSION }}
Original file line number Diff line number Diff line change 7
7
"hooks" : {
8
8
"before:bump" : " yarn declarations; yarn build:schemas" ,
9
9
"after:bump" : " yarn package:x64; yarn package:arm64" ,
10
- "after:release" : " VERSION=${version} scripts/create-homebrew-tap-pr.sh "
10
+ "after:release" : " export VERSION=${version}; echo 'VERSION=${version}' >> $GITHUB_ENV "
11
11
}
12
12
}
Original file line number Diff line number Diff line change 64
64
"build:pretty-types" : " yarn prettier --write distribution/danger.d.ts; yarn prettier --parser flow distribution/danger.js.flow --write" ,
65
65
"build:watch" : " tsc -w" ,
66
66
"link" : " yarn run build && chmod +x distribution/commands/danger.js && yarn link" ,
67
+ "package" : " yarn run pkg . --output brew-distribution/danger; zip -j brew-distribution/danger-macos.zip brew-distribution/danger; shasum -a 256 brew-distribution/danger-macos.zip" ,
67
68
"package:x64" : " yarn run pkg . --output brew-distribution/danger-x64 --targets node16-macos-x64; zip -j brew-distribution/danger-macos-x64.zip brew-distribution/danger-x64; shasum -a 256 brew-distribution/danger-macos-x64.zip" ,
68
69
"package:arm64" : " yarn run pkg . --output brew-distribution/danger-arm64 --targets node16-macos-arm64; zip -j brew-distribution/danger-macos-arm64.zip brew-distribution/danger-arm64; shasum -a 256 brew-distribution/danger-macos-arm64.zip" ,
69
70
"declarations" : " ts-node ./scripts/create-danger-dts.ts" ,
Original file line number Diff line number Diff line change @@ -19,14 +19,22 @@ echo "SHA_X64=$SHA_X64"
19
19
SHA_ARM64=$( shasum -a 256 ${FILE_ARM64} | cut -f 1 -d " " )
20
20
echo " SHA_ARM64=$SHA_ARM64 "
21
21
22
+ # Set up SSH
23
+ mkdir -p ~ /.ssh
24
+ echo " ${HOMEBREW_TAP_DEPLOY_SECRET_KEY} " > ~ /.ssh/id_rsa
25
+ chmod 600 ~ /.ssh/id_rsa
26
+ git config --global user.name danger
27
+ git config --global user.email danger@users.noreply.github.com
28
+ eval " $( ssh-agent -s) "
29
+ ssh-add ~ /.ssh/id_rsa
30
+ ssh-keyscan -H github.com >> ~ /.ssh/known_hosts
31
+ ssh -o StrictHostKeyChecking=no -F /dev/null -vT git@github.com
32
+
22
33
# Clone tap repo
23
34
HOMEBREW_TAP_TMPDIR=$( mktemp -d)
24
- git clone --depth 1 https:// github.com/ danger/homebrew-tap.git " $HOMEBREW_TAP_TMPDIR "
35
+ git clone --depth 1 git@ github.com: danger/homebrew-tap.git " $HOMEBREW_TAP_TMPDIR "
25
36
cd " $HOMEBREW_TAP_TMPDIR " || exit 1
26
37
27
- # git config user.name danger
28
- # git config user.email danger@users.noreply.github.com
29
-
30
38
# Write formula
31
39
echo " class DangerJs < Formula" > danger-js.rb
32
40
echo " homepage \" https://github.com/danger/danger-js\" " >> danger-js.rb
@@ -53,4 +61,6 @@ echo "end" >> danger-js.rb
53
61
# Commit changes
54
62
git add danger-js.rb
55
63
git commit -m " Releasing danger-js version ${VERSION} "
56
- git push origin master
64
+ git remote rm origin
65
+ git remote add origin git@github.com:danger/homebrew-tap.git
66
+ git push origin master
You can’t perform that action at this time.
0 commit comments