chore: update app deploy script and add link to notify

pull/90/head
moonrailgun 2 years ago
parent c6b3f1ca14
commit c4db1a86f6

@ -6,6 +6,7 @@ const path = require('path');
// reference: https://docs.codemagic.io/yaml-basic-configuration/environment-variables/#artifact-links
const artifactLinks = process.env['CM_ARTIFACT_LINKS'];
const tailchatSubscribeId = process.env['TAILCHAT_SUBSCRIBE_ID'];
const branch = process.env['CM_BRANCH'];
console.log('artifactLinks:', artifactLinks);
@ -18,10 +19,15 @@ if (tailchatSubscribeId) {
links
.map((link) => {
const { name, url, md5, versionName } = link;
const pagesUrl =
branch === 'master'
? 'https://tailchat.pages.dev/app-release.apk'
: `https://${branch}.tailchat.pages.dev/app-release.apk`;
return (
`${name}\n` +
`version: ${versionName}(${md5})\n` +
`[url=${url}]Download[/url]`
`[url=${pagesUrl}]Download from Pages[/url] or [url=${url}]Download from CI[/url]`
);
})
.join('\n=========\n');

@ -46,14 +46,22 @@ workflows:
recipients:
- moonrailgun@gmail.com
scripts:
- name: Notify artifact URL to Tailchat
script: |
node scripts/notify-links.js
- name: Install wrangler
script: npm install -g wrangler
- name: Deploy to Cloudflare Pages
script: |
wrangler pages publish android/app/build/outputs/apk/release --project-name tailchat --branch $CM_BRANCH
if [[ -f ~/SUCCESS ]]; then
if [[ $CM_BRANCH == "master" ]]; then
# deploy to production
wrangler pages publish android/app/build/outputs/apk/release --project-name tailchat --branch main
else
wrangler pages publish android/app/build/outputs/apk/release --project-name tailchat --branch $CM_BRANCH
fi
fi
- name: Notify artifact URL to Tailchat
script: |
node scripts/notify-links.js
ios:
name: build, test & publish iOS version

Loading…
Cancel
Save