mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-04 10:05:35 -06:00
chore : pipeline improvements (#678)
* Add support for --PR flag in getRandomVersion.sh * Add --PR flag to getRandomVersion.sh calls Updated getRandomVersion.sh call to include --PR flag for both Android and iOS bundle creation. * Update maestro-test.yml * Update maestro-test.yml * Update maestro-test.yml * Create sendDiscordMessage * Replace Fastlane notifications with Node script * Rename sendDiscordMessage to sendDiscordMessage.js * Update sendDiscordMessage.js * Update sendDiscordMessage.js * Fux * frf * fix * gg * fix: Fix incorrect return of on Web * fix: Fix Versioned URL
This commit is contained in:
@@ -3,6 +3,12 @@ set -euo pipefail
|
||||
|
||||
FILE="ota.version"
|
||||
|
||||
# Check if --PR flag is passed
|
||||
IS_PR=false
|
||||
if [[ "${1:-}" == "--PR" ]]; then
|
||||
IS_PR=true
|
||||
fi
|
||||
|
||||
# Array of sentences
|
||||
sentences=(
|
||||
"Git Blame violet"
|
||||
@@ -44,9 +50,14 @@ new_sentence=$(get_random_sentence)
|
||||
alphanum_suffix=$(get_random_alphanum)
|
||||
version_string="${new_sentence} (${alphanum_suffix})"
|
||||
|
||||
# Prefix for PR builds
|
||||
if $IS_PR; then
|
||||
version_string="PULL_REQUEST - ${version_string}"
|
||||
fi
|
||||
|
||||
# Write atomically
|
||||
tmp="${FILE}.tmp.$$"
|
||||
echo "$version_string" > "$tmp"
|
||||
mv "$tmp" "$FILE"
|
||||
|
||||
echo "✅ Updated $FILE with: \"$version_string\""
|
||||
echo "✅ Updated $FILE with: \"$version_string\""
|
||||
|
||||
@@ -19,7 +19,7 @@ fi
|
||||
cd ../..
|
||||
yarn createBundle:android
|
||||
cd android/App-Bundles
|
||||
bash ../../scripts/getRandomVersion.sh
|
||||
bash ../../scripts/getRandomVersion.sh --PR
|
||||
git add .
|
||||
git commit -m "OTA-Update - $(date +'%b %d %H:%M')"
|
||||
git push https://x-access-token:$SIGNING_REPO_PAT@github.com/Jellify-Music/App-Bundles.git "$target_branch"
|
||||
@@ -44,10 +44,10 @@ rm -rf Readme.md
|
||||
cd ../..
|
||||
yarn createBundle:ios
|
||||
cd ios/App-Bundles
|
||||
bash ../../scripts/getRandomVersion.sh
|
||||
bash ../../scripts/getRandomVersion.sh --PR
|
||||
git add .
|
||||
git commit -m "OTA-Update - $(date +'%b %d %H:%M')"
|
||||
git push https://x-access-token:$SIGNING_REPO_PAT@github.com/Jellify-Music/App-Bundles.git "$target_branch"
|
||||
cd ..
|
||||
rm -rf App-Bundles
|
||||
cd ..
|
||||
cd ..
|
||||
|
||||
14
scripts/sendDiscordMessage.js
Normal file
14
scripts/sendDiscordMessage.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const WEBHOOK_URL = process.env.DISCORD_WEBHOOK_URL
|
||||
|
||||
async function sendDiscordMessage(message) {
|
||||
const res = await fetch(WEBHOOK_URL, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ content: message }),
|
||||
})
|
||||
|
||||
console.log('Sent:', message)
|
||||
}
|
||||
|
||||
const msg = process.argv.slice(2).join(' ')
|
||||
sendDiscordMessage(msg)
|
||||
Reference in New Issue
Block a user