mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-24 15:36:59 +01:00
Merge remote-tracking branch 'origin/master' into externalw
This commit is contained in:
commit
b63dd690aa
2 changed files with 56 additions and 0 deletions
40
appcenter-post-build-get-pr-number.js
Executable file
40
appcenter-post-build-get-pr-number.js
Executable file
|
@ -0,0 +1,40 @@
|
||||||
|
const https = require('https');
|
||||||
|
|
||||||
|
const auth = 'Basic ' + Buffer.from('Overtorment' + ':' + process.env.GITHUB).toString('base64');
|
||||||
|
|
||||||
|
const req = https.request(
|
||||||
|
{
|
||||||
|
hostname: 'api.github.com',
|
||||||
|
port: 443,
|
||||||
|
path: '/repos/BlueWallet/BlueWallet/pulls',
|
||||||
|
method: 'GET',
|
||||||
|
headers: { 'User-Agent': 'BlueWallet bot', Authorization: auth },
|
||||||
|
},
|
||||||
|
resp => {
|
||||||
|
let data = '';
|
||||||
|
|
||||||
|
resp.on('data', chunk => {
|
||||||
|
data += chunk;
|
||||||
|
});
|
||||||
|
|
||||||
|
resp.on('end', () => {
|
||||||
|
try {
|
||||||
|
const prs = JSON.parse(data);
|
||||||
|
for (let pr of prs) {
|
||||||
|
if (process.env.APPCENTER_BRANCH === pr.head.ref) {
|
||||||
|
console.log(pr.number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
console.log('got json: ', data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
req.on('error', e => {
|
||||||
|
console.error(e);
|
||||||
|
});
|
||||||
|
|
||||||
|
req.end();
|
16
appcenter-post-build.sh
Executable file
16
appcenter-post-build.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
echo Uploading to Appetize and publishing link to Github...
|
||||||
|
|
||||||
|
FILENAME="$APPCENTER_OUTPUT_DIRECTORY/app-release.apk"
|
||||||
|
|
||||||
|
if [ -f $FILENAME ]; then
|
||||||
|
APTZ=`curl "https://$APPETIZE@api.appetize.io/v1/apps" -F "file=@$FILENAME" -F "platform=android"`
|
||||||
|
echo Apptezize response:
|
||||||
|
echo $APTZ
|
||||||
|
APPURL=`node -e "let e = JSON.parse('$APTZ'); console.log(e.publicURL);"`
|
||||||
|
echo App url: $APPURL
|
||||||
|
PR=`node appcenter-post-build-get-pr-number.js`
|
||||||
|
echo PR: $PR
|
||||||
|
curl -X POST --data "{\"body\":\"Test this build in browser:\n\n(ノ◕ヮ◕)ノ*:・゚✧ $APPURL\n\n(posted automatically)\"}" -u "Overtorment:$GITHUB" "https://api.github.com/repos/BlueWallet/BlueWallet/issues/$PR/comments"
|
||||||
|
fi
|
Loading…
Add table
Reference in a new issue