Skip to content

Commit

Permalink
Add better repo release structure for F-droid, improve readme for and…
Browse files Browse the repository at this point in the history
…roid builds and releases (#594)
  • Loading branch information
aeharding authored Aug 4, 2023
1 parent 1048a9a commit 8e83e36
Show file tree
Hide file tree
Showing 8 changed files with 2,038 additions and 115 deletions.
5 changes: 5 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"before:bump": "npx capacitor-set-version -v ${version} -b $BUILD"
}
}
48 changes: 40 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,44 @@ pnpm run dev

### iOS Native App

To build the iOS native app, make sure you have [Xcode](https://developer.apple.com/xcode/), [Cocoapods](https://cocoapods.org/) and the [Ionic CLI](https://ionicframework.com/docs/cli) installed, and have run `pnpm install` from the _Local Setup_ instructions above.
To build the iOS native app:

You will then need to install Podfile dependencies:
1. Install [Node](https://nodejs.org/en)
2. Install [Ionic CLI](https://ionicframework.com/docs/cli)
3. Install [Xcode](https://developer.apple.com/xcode/)
4. [Cocoapods](https://cocoapods.org/)

Then, build the project and copy web dependencies over:

```sh
cd ios/App
pod install
corepack enable
pnpm install
ionic capacitor build ios
```

Then, build the project and copy web dependencies over:
Finally, can run the project with `CMD+R`.

### Android Native App

To build the Android native app:

1. Install [Node](https://nodejs.org/en)
2. Install [Ionic CLI](https://ionicframework.com/docs/cli)
3. Install [Android Studio](https://developer.android.com/studio)

In Voyager source code directory:

```sh
ionic capacitor build ios
corepack enable
pnpm install
ionic capacitor build android
```

Once Xcode opens, navigate to the `Info.plist` file and change `Bundle version` to `1` for local builds.
Android Studio should open.

Finally, can run the project with `CMD+R`.
You may need to sync. `File -> Sync Project with Gradle Files`

Finally, can run the project with `Ctrl+R`.

### Testing

Expand All @@ -173,6 +193,18 @@ Voyager uses [Vitest](https://vitest.dev). You can run the test suite with:
pnpm test
```

### 🚀 Releasing

To release a new version:

```sh
BUILD=123; npx release-it
```

Make sure the build number is incremental. This is used for F-droid.

Voyager uses [Ionic App Flow](https://ionic.io/appflow) for Apple App Store and Android Play Store builds. Unfortunately, there's no way to provide public access to build logs and artifacts. Hopefully someday. :-)

## 📲 PWA

Voyager works best added to the homescreen. There are certain features that only work there, like badging and smooth page transitions.
Expand Down
6 changes: 2 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
apply plugin: 'com.android.application'

def sysBuildNumber = System.getenv("CI_BUILD_NUMBER")

android {
namespace "app.vger.voyager"
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "app.vger.voyager"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode Integer.valueOf(sysBuildNumber)
versionName "1.0." + sysBuildNumber
versionCode 1
versionName "1.3.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
2 changes: 1 addition & 1 deletion appflow.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"appId": "9f0851ec",
"dependencyInstallCommand": "corepack enable && pnpm i",
"webBuildCommand": "pnpm build"
"webBuildCommand": "if [ \"$CI_PLATFORM\" != \"web\" ]; then npx trapeze run appflow.yml -y --$CI_PLATFORM; fi && pnpm build"
}
]
}
9 changes: 9 additions & 0 deletions appflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
vars:
CI_BUILD_NUMBER:
default: 1

platforms:
ios:
buildNumber: $CI_BUILD_NUMBER
android:
versionCode: $CI_BUILD_NUMBER
104 changes: 52 additions & 52 deletions ios/App/App/Info.plist
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Voyager</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.$(CI_BUILD_NUMBER)</string>
<key>CFBundleVersion</key>
<string>$(CI_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSCameraUsageDescription</key>
<string>Attach photo to a new post</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Save photos to device</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
</dict>
</plist>
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Voyager</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSCameraUsageDescription</key>
<string>Attach photo to a new post</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Save photos to device</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
</dict>
</plist>
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@trapezedev/configure": "^7.0.10",
"@types/history": "^4.7.11",
"@types/jest": "^29.5.2",
"@types/js-cookie": "^3.0.3",
Expand All @@ -62,6 +63,7 @@
"@vitejs/plugin-legacy": "^4.0.5",
"@vitejs/plugin-react": "^4.0.1",
"capacitor-application-context": "^0.0.1",
"capacitor-set-version": "^2.0.13",
"date-fns": "^2.30.0",
"dexie": "^3.2.4",
"dexie-react-hooks": "^1.1.6",
Expand Down Expand Up @@ -96,6 +98,7 @@
"react-textarea-autosize": "^8.5.2",
"react-transition-state": "^2.1.1",
"react-virtuoso": "^4.3.11",
"release-it": "^16.1.3",
"remark-gfm": "^3.0.1",
"terser": "^5.18.1",
"typescript": "^5.1.3",
Expand Down
Loading

0 comments on commit 8e83e36

Please sign in to comment.