Bluesky app fork with some witchin' additions 💫

Use EAS managed build number, run build/submit on GH Actions (#2841)

* use eas version code

* test

* try sync

* try sync

* use eas to manage the version code

* apply build numbers to dist

* test script

* set this to production or now

* revert to schedule

* testing on 1.69

* autosubmit

* autosubmit, remove cheat

* finished!!!!!

try again

try again

try again

try again

add same for android

maybe now

omg wow i messed that up?

once again

once again

again

error?

add caching

add caching

try again again again again

try again again again

try again again

try again

try this a different way

another test

testing this again

* hack

* write environment variables

* ready to go

* final test

* Revert "final test"

This reverts commit 6580c5c0974db25a3704b683673c41471a6ad0cf.

authored by hailey.at and committed by

GitHub 874489b4 ba71e4b4

+172 -99
+61
.github/workflows/build-submit-android.yml
··· 1 + --- 2 + name: Build and Submit Android 3 + 4 + on: 5 + workflow_dispatch: 6 + inputs: 7 + profile: 8 + type: choice 9 + description: Build profile to use 10 + options: 11 + - production 12 + 13 + jobs: 14 + build: 15 + name: Build and Submit Android 16 + runs-on: ubuntu-latest 17 + steps: 18 + - name: Check for EXPO_TOKEN 19 + run: > 20 + if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then 21 + echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions" 22 + exit 1 23 + fi 24 + 25 + - name: ⬇️ Checkout 26 + uses: actions/checkout@v4 27 + 28 + - name: 🔧 Setup Node 29 + uses: actions/setup-node@v3 30 + with: 31 + node-version: 18.x 32 + cache: yarn 33 + 34 + - name: 🔨 Setup EAS 35 + uses: expo/expo-github-action@v8 36 + with: 37 + expo-version: latest 38 + eas-version: latest 39 + token: ${{ secrets.EXPO_TOKEN }} 40 + 41 + - name: ⛏️ Setup EAS local builds 42 + run: yarn global add eas-cli-local-build-plugin 43 + 44 + - uses: actions/setup-java@v4 45 + with: 46 + distribution: 'temurin' 47 + java-version: '17' 48 + 49 + - name: ⚙️ Install dependencies 50 + run: yarn install 51 + 52 + - name: ✏️ Write environment variables 53 + run: | 54 + echo "${{ secrets.ENV_TOKEN }}" > .env 55 + echo "${{ secrets.GOOGLE_SERVICES_TOKEN }}" > google-services.json 56 + 57 + - name: 🏗️ EAS Build 58 + run: yarn use-build-number eas build -p android --profile production --local --output build.aab --non-interactive 59 + 60 + - name: 🚀 Deploy 61 + run: eas submit -p android --non-interactive --path build.aab
+72
.github/workflows/build-submit-ios.yml
··· 1 + --- 2 + name: Build and Submit iOS 3 + 4 + on: 5 + schedule: 6 + - cron: '0 5 * * *' 7 + workflow_dispatch: 8 + inputs: 9 + profile: 10 + type: choice 11 + description: Build profile to use 12 + options: 13 + - production 14 + 15 + jobs: 16 + build: 17 + name: Build and Submit iOS 18 + runs-on: macos-14 19 + steps: 20 + - name: Check for EXPO_TOKEN 21 + run: > 22 + if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then 23 + echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions" 24 + exit 1 25 + fi 26 + 27 + - name: ⬇️ Checkout 28 + uses: actions/checkout@v4 29 + 30 + - name: 🔧 Setup Node 31 + uses: actions/setup-node@v3 32 + with: 33 + node-version: 18.x 34 + cache: yarn 35 + 36 + - name: 🔨 Setup EAS 37 + uses: expo/expo-github-action@v8 38 + with: 39 + expo-version: latest 40 + eas-version: latest 41 + token: ${{ secrets.EXPO_TOKEN }} 42 + 43 + - name: ⛏️ Setup EAS local builds 44 + run: yarn global add eas-cli-local-build-plugin 45 + 46 + - name: ⚙️ Install dependencies 47 + run: yarn install 48 + 49 + - name: ☕️ Setup Cocoapods 50 + uses: maxim-lobanov/setup-cocoapods@v1 51 + with: 52 + version: 1.14.3 53 + 54 + - name: 💾 Cache Pods 55 + uses: actions/cache@v3 56 + id: pods-cache 57 + with: 58 + path: ./ios/Pods 59 + # We'll use the yarn.lock for our hash since we don't yet have a Podfile.lock. Pod versions will not 60 + # change unless the yarn version changes as well. 61 + key: ${{ runner.os }}-pods-${{ hashFiles('yarn.lock') }} 62 + 63 + - name: ✏️ Write environment variables 64 + run: | 65 + echo "${{ secrets.ENV_TOKEN }}" > .env 66 + echo "${{ secrets.GOOGLE_SERVICES_TOKEN }}" > google-services.json 67 + 68 + - name: 🏗️ EAS Build 69 + run: yarn use-build-number eas build -p ios --profile production --local --output build.ipa --non-interactive 70 + 71 + - name: 🚀 Deploy 72 + run: eas submit -p ios --non-interactive --path build.ipa
-52
.github/workflows/deploy-nightly-testflight.yml
··· 1 - name: Deploy Nightly Testflight Release 2 - 3 - on: 4 - schedule: 5 - - cron: '0 5 * * *' 6 - 7 - jobs: 8 - build: 9 - name: Deploy Nightly Testflight Release 10 - runs-on: ubuntu-latest 11 - permissions: 12 - contents: write 13 - 14 - steps: 15 - - name: Check for EXPO_TOKEN 16 - run: | 17 - if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then 18 - echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions" 19 - exit 1 20 - fi 21 - 22 - - name: Checkout 23 - uses: actions/checkout@v4 24 - 25 - - name: Setup Node 26 - uses: actions/setup-node@v3 27 - with: 28 - node-version: 18.x 29 - cache: yarn 30 - 31 - - name: Setup EAS 32 - uses: expo/expo-github-action@v8 33 - with: 34 - eas-version: latest 35 - token: ${{ secrets.EXPO_TOKEN }} 36 - 37 - - name: Install dependencies 38 - run: yarn install 39 - 40 - - name: Bump build number 41 - run: yarn bump:ios 42 - 43 - - name: EAS build and submit 44 - run: eas build -p ios --profile production --auto-submit --non-interactive 45 - 46 - - name: Commit 47 - uses: stefanzweifel/git-auto-commit-action@v5 48 - with: 49 - commit_message: Nightly iOS Build Bump 50 - branch: main 51 - commit_user_name: github-actions[bot] 52 - commit_user_email: github-actions[bot]@users.noreply.github.com
+4 -19
app.config.js
··· 11 11 resizeMode: 'cover', 12 12 } 13 13 14 - module.exports = function () { 14 + module.exports = function (config) { 15 15 /** 16 16 * App version number. Should be incremented as part of a release cycle. 17 17 */ 18 18 const VERSION = pkg.version 19 19 20 20 /** 21 - * iOS build number. Must be incremented for each TestFlight version. 22 - * WARNING: Always leave this variable on line 24! If it is moved, you need to update ./scripts/bumpIosBuildNumber.sh 23 - */ 24 - const IOS_BUILD_NUMBER = '7' 25 - 26 - /** 27 - * Android build number. Must be incremented for each release. 28 - * WARNING: Always leave this variable on line 30! If it is moved, you need to update ./scripts/bumpAndroidBuildNumber.sh 29 - */ 30 - const ANDROID_VERSION_CODE = 62 31 - 32 - /** 33 21 * Uses built-in Expo env vars 34 22 * 35 23 * @see https://docs.expo.dev/build-reference/variables/#built-in-environment-variables 36 24 */ 37 25 const PLATFORM = process.env.EAS_BUILD_PLATFORM 38 26 39 - /** 40 - * Additional granularity for the `dist` field 41 - */ 42 27 const DIST_BUILD_NUMBER = 43 - PLATFORM === 'android' ? ANDROID_VERSION_CODE : IOS_BUILD_NUMBER 28 + PLATFORM === 'android' 29 + ? process.env.BSKY_ANDROID_VERSION_CODE 30 + : process.env.BSKY_IOS_BUILD_NUMBER 44 31 45 32 return { 46 33 expo: { ··· 57 44 userInterfaceStyle: 'automatic', 58 45 splash: SPLASH_CONFIG, 59 46 ios: { 60 - buildNumber: IOS_BUILD_NUMBER, 61 47 supportsTablet: false, 62 48 bundleIdentifier: 'xyz.blueskyweb.app', 63 49 config: { ··· 85 71 backgroundColor: '#ffffff', 86 72 }, 87 73 android: { 88 - versionCode: ANDROID_VERSION_CODE, 89 74 icon: './assets/icon.png', 90 75 adaptiveIcon: { 91 76 foregroundImage: './assets/icon-android-foreground.png',
+17 -2
eas.json
··· 1 1 { 2 2 "cli": { 3 3 "version": ">= 3.8.1", 4 - "promptToConfigurePushNotifications": false 4 + "promptToConfigurePushNotifications": false, 5 + "appVersionSource": "remote" 5 6 }, 6 7 "build": { 7 8 "base": { ··· 28 29 "production": { 29 30 "extends": "base", 30 31 "ios": { 31 - "resourceClass": "large" 32 + "resourceClass": "large", 33 + "autoIncrement": true 34 + }, 35 + "android": { 36 + "autoIncrement": true 37 + }, 38 + "channel": "production" 39 + }, 40 + "github": { 41 + "extends": "base", 42 + "ios": { 43 + "autoIncrement": true 44 + }, 45 + "android": { 46 + "autoIncrement": true 32 47 }, 33 48 "channel": "production" 34 49 }
+7 -6
package.json
··· 1 1 { 2 2 "name": "bsky.app", 3 - "version": "1.68.0", 3 + "version": "1.69.0", 4 4 "private": true, 5 5 "engines": { 6 6 "node": ">=18" ··· 12 12 "android": "expo run:android", 13 13 "ios": "expo run:ios", 14 14 "web": "expo start --web", 15 + "use-build-number": "./scripts/useBuildNumberEnv.sh", 15 16 "build-web": "expo export:web && node ./scripts/post-web-build.js && cp -v ./web-build/static/js/*.* ./bskyweb/static/js/", 16 - "build-all": "yarn intl:build && eas build --platform all", 17 + "build-all": "yarn intl:build && yarn use-build-number eas build --platform all", 18 + "build-ios": "yarn use-build-number eas build -p ios", 19 + "build-android": "yarn use-build-number eas build -p android", 20 + "build": "yarn use-build-number eas build", 17 21 "start": "expo start --dev-client", 18 22 "start:prod": "expo start --dev-client --no-dev --minify", 19 23 "clean-cache": "rm -rf node_modules/.cache/babel-loader/*", ··· 36 40 "intl:check": "yarn intl:extract && git diff-index -G'(^[^\\*# /])|(^#\\w)|(^\\s+[^\\*#/])' HEAD || (echo '\n⚠️ i18n detected un-extracted translations\n' && exit 1)", 37 41 "intl:extract": "lingui extract", 38 42 "intl:compile": "lingui compile", 39 - "nuke": "rm -rf ./node_modules && rm -rf ./ios && rm -rf ./android", 40 - "bump": "./scripts/bumpIosBuildNumber.sh && ./scripts/bumpAndroidBuildNumber.sh", 41 - "bump:ios": "./scripts/bumpIosBuildNumber.sh", 42 - "bump:android": "./scripts/bumpAndroidBuildNumber.sh" 43 + "nuke": "rm -rf ./node_modules && rm -rf ./ios && rm -rf ./android" 43 44 }, 44 45 "dependencies": { 45 46 "@atproto/api": "^0.9.5",
-10
scripts/bumpAndroidBuildNumber.sh
··· 1 - #!/bin/sh 2 - # The number here should always be the line number the iOS build variable is on 3 - line=$(sed "30q;d" ./app.config.js) 4 - currentBuildNumber=$(echo "$line" | grep -oE '[0-9]+([.][0-9]+)?') 5 - newBuildNumber=$((currentBuildNumber+1)) 6 - newBuildVariable="const ANDROID_VERSION_CODE = '$newBuildNumber'" 7 - sed -i.bak "30s/.*/ $newBuildVariable/" ./app.config.js 8 - rm -rf ./app.config.js.bak 9 - 10 - echo "Android build number bumped to $newBuildNumber"
-10
scripts/bumpIosBuildNumber.sh
··· 1 - #!/bin/sh 2 - # The number here should always be the line number the iOS build variable is on 3 - line=$(sed "24q;d" ./app.config.js) 4 - currentBuildNumber=$(echo "$line" | grep -oE '[0-9]+([.][0-9]+)?') 5 - newBuildNumber=$((currentBuildNumber+1)) 6 - newBuildVariable="const IOS_BUILD_NUMBER = '$newBuildNumber'" 7 - sed -i.bak "24s/.*/ $newBuildVariable/" ./app.config.js 8 - rm -rf ./app.config.js.bak 9 - 10 - echo "iOS build number bumped to $newBuildNumber"
+11
scripts/useBuildNumberEnv.sh
··· 1 + #!/bin/bash 2 + outputIos=$(eas build:version:get -p ios) 3 + outputAndroid=$(eas build:version:get -p android) 4 + currentIosVersion=${outputIos#*buildNumber - } 5 + currentAndroidVersion=${outputAndroid#*versionCode - } 6 + 7 + BSKY_IOS_BUILD_NUMBER=$((currentIosVersion+1)) 8 + BSKY_ANDROID_VERSION_CODE=$((currentAndroidVersion+1)) 9 + 10 + bash -c "BSKY_IOS_BUILD_NUMBER=$BSKY_IOS_BUILD_NUMBER BSKY_ANDROID_VERSION_CODE=$BSKY_ANDROID_VERSION_CODE $*" 11 +