Skip to content

Commit

Permalink
release/v1.0.0 (#654)
Browse files Browse the repository at this point in the history
* chore: Github action for creating release candidate (#618)

* chore: update version

* chore: create flow and configure release types

* chore: edit title names

* chore: documentation

* chore: spelling

* chore: remove 'the'

* chore: 'there are features'

* chore: 'repo uses github actions'

* chore: 'develop'

* chore: add 'RC' and SHA to version

* chore: update name

* chore: typos

* chore: take out unnecessary file

* chore: update release candidate action to properly name pr (#639)

* fix: allow metrics env variables to be inlined (#643)

To quote [Expo's docs][0]:

> **Every environment variable must be statically referenced as a
> property of `process.env` using JavaScript's dot notation for it to be
> inlined.** For example, the expression `process.env.EXPO_PUBLIC_KEY`
> is valid and will be inlined.

Our metrics environment variables weren't doing this, so they couldn't
be inlined.

Closes [#640].

[0]: https://docs.expo.dev/guides/environment-variables/#how-to-read-from-environment-variables
[#640]: #640

* fix: use proper timestamp for location metadata (#645)

We should be using an ISO timestamp instead of a string number here.

Because `position` can be undefined and we were checking that earlier, I
moved things around a tiny bit to only check that once.

Closes [#644].

[#644]: #644

* feature: edit a track (#633)

* Adds edit icon to track. 
* Navigates to edit track screen if it is user's track. 
* Edit track screen added using the editor component
* Hook added for editing a track
* Doesn't allow preset to change if it is a track

* feat: show config details and upload new config (#608)

* chore: scaffolding for screens

* chore: translations

* chore: added import button

* chore: translations

* chore: create select file function

* chore: create select file and import config hook

* chore: use hook

* chore: use reusable file picker

* chore: update file extension to be 'comapeocat'

* Update `@mapeo/core` to 9.0.0-alpha.23 (#630)

* WIP: update `@mapeo/core` to 9.0.0-alpha.17

This isn't finished but does most of the upgrading needed.

* WIP: update to `@mapeo/[email protected]`

* chore: update to latest core, ipc, and schema

* chore: update to latest core, ipc, and schema in backend

* chore: update type

* chore: remove attachments from tracks

* Update `@mapeo/core` to latest (again)

---------

Co-authored-by: ErikSin <[email protected]>

* chore: EXPO_PUBLIC_FEATURE_TEST_DATA_UI set to true in RC profile (#652)

* chore: test data generator

* chore: take out npx executable

* Changes to using the new hook for matching a device to itself. (#653) (#667)

Co-authored-by: cimigree <[email protected]>

* Fixes ternary on editing an observation for changing preset (#668)

* fix: leave current project when joining another project (#646) (#670)

* fix: project name appears after successfully joining via invite (#672) (#690)

* chore: update copy to warn user about potential loss of data (#691) (#693)

* chore: copy

* chore: translations

* chore: copy

* chore: copy

* chore:translations

* chore: add period

* chore: styling

* feat: show date user added to project and screen instructing user on how to leave project (#674) (#692)

* chore: update device card and device name

* chore: translations

* chore: update device card

* chore: mapeo => CoMapeo

* chore: unnecessary array

* chore: update deviceCard

* chore: title sizing

* chore: bold

* chore: add question icon

* chore: remove unusedimport

* chore: remove unneccesary justify content

* fix: manage "obscured" config variables via babel env variable transform (#656) (#695)

Co-authored-by: Gregor MacLennan <[email protected]>

* fix: prevent text overflow in invitee role selection screen (#682) (#698)

* fix: update copy to replace Mapeo with CoMapeo (#684) (#699)

* fix: presets forever loading (#642) (#701)

Co-authored-by: cimigree <[email protected]>

* fix: handle category-related changes after importing a config more elegantly (#687) (#700)

* fix: do not set observation metadata when using manual gps coordinate (#705) (#706)

Co-authored-by: Evan Hahn <[email protected]>

* chore: tidy type for location callback (#710)

Cherry-pick of 306aa51.

* fix: simplify "accurate location" hook (#712)

Cherry picked from commit a8c7390.

* fix: create test data with proper metadata (#713)

Cherry picked from commit 81514f9.

* fix: always specify a device type (#711)

Cherry picked from commit cf09155.

* chore: add env file template (#697) (#714)

* fix: populate subject field when sharing observation via email (#680) (#715)

* fix: manual gps prompt when no location service or innacurate location (#702) (#719)

* fix: prompts user to manually add gps when no or inaccurate location

* chore: translations

* chore: small fixes

* chore: pr fixes

* chore: remove project config icon (#717) (#721)

* chore: New Crowdin updates (#694) (#722)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (German)

* New translations en.json (Japanese)

* New translations en.json (Mongolian)

* New translations en.json (Dutch)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Khmer)

* New translations en.json (Tamil)

* New translations en.json (Thai)

* New translations en.json (Burmese)

* New translations en.json (Sinhala)

* New translations en.json (Swahili)

* New translations en.json (Nepali)

* New translations en.json (Ogiek)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (German)

* New translations en.json (Japanese)

* New translations en.json (Mongolian)

* New translations en.json (Dutch)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Khmer)

* New translations en.json (Tamil)

* New translations en.json (Thai)

* New translations en.json (Burmese)

* New translations en.json (Sinhala)

* New translations en.json (Swahili)

* New translations en.json (Nepali)

* New translations en.json (Ogiek)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Portuguese, Brazilian)

---------

Co-authored-by: Digidem Bot <[email protected]>

* chore: update dependencies (#716) (#723)

* chore: update dependencies

This updates all of our (Co)Mapeo dependencies to their latest versions.
This should be the last time we do this before the 1.0 releases of those
modules.

* Default config's extension is `.comapeocat`

* chore: update mapeo-schema for ESM fix

* chore: update backend deps

* chore: update @electron/asar patch

* fix: temp fix

---------

Co-authored-by: Evan Hahn <[email protected]>
Co-authored-by: Gregor MacLennan <[email protected]>

* chore: update EAS config (#726) (#727)

* chore: update EAS config node version & VCS

* remove versionCode from app.json

* chore: change how versions are named (#725) (#728)

* chore: change how versions are named

* set node version used for builds

* chore: update EAS config node version & VCS

* remove versionCode from app.json

* nit: capitalize RC

* Changes isEnabled for metrics permission to be enabled by default. (#734)

* fix: update message content when sharing observation (#676) (#736)

* chore: New Crowdin updates (#733) (#737)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (German)

* New translations en.json (Japanese)

* New translations en.json (Mongolian)

* New translations en.json (Dutch)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Khmer)

* New translations en.json (Tamil)

* New translations en.json (Thai)

* New translations en.json (Burmese)

* New translations en.json (Sinhala)

* New translations en.json (Swahili)

* New translations en.json (Nepali)

* New translations en.json (Ogiek)

Co-authored-by: Digidem Bot <[email protected]>

* chore: update CoMapeo dependencies to final release versions (#732) (#738)

This updates CoMapeo dependencies to their final release versions.
Notably, several names changed. For example, `@mapeo/core` is now
`@comapeo/core`.

There are no other changes other than renames and version bumps.

Co-authored-by: Evan Hahn <[email protected]>

* fix: mapeo/schema to comapeo/schema (#739) (#741)

* chore: remove test data generator (#735)

* fix: update to `@comapeo/[email protected]` (#746)

Cherry pick of 9b121f0.

* fix: fix issue with category icons not loading within reasonable time after importing a config (#748) (#750)

* chore: move query invalidation of config-related queries to useImportProjectConfig() (#749) (#751)

* chore: uninstall unused mock data package (#752) (#753)

This change should have no user impact.

This uninstalls `@mapeo/mock-data`, as it is unused.

Co-authored-by: Evan Hahn <[email protected]>

* chore: run CI workflow on pushes to develop and release-related branches (#740) (#754)

* fix: Only allow coordinator to update config (#756) (#759)

* chore: check if user is coordinator

* chore: create useGetOwnRole hook

* chore: useGetOwnRole hook in config screen

* chore: change role key

* chore: update `@types/react-native-zeroconf` to latest version (#763) (#773)

I think this is a useful change on its own but should also make [an
upcoming change][0] easier.

[0]: #747

Co-authored-by: Evan Hahn <[email protected]>

* fix: unpublish dns-sd service (#747) (#774)

Co-authored-by: Gregor MacLennan <[email protected]>
Co-authored-by: Evan Hahn <[email protected]>
Co-authored-by: ErikSin <[email protected]>

* chore: configure Sentry environment (#730) (#775)

Co-authored-by: Gregor MacLennan <[email protected]>

* chore: update copy (#767) (#776)

* chore: updated copy

* chore: take out unused variables

* New Crowdin updates (#743) (#777)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (German)

* New translations en.json (Japanese)

* New translations en.json (Mongolian)

* New translations en.json (Dutch)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Khmer)

* New translations en.json (Tamil)

* New translations en.json (Thai)

* New translations en.json (Burmese)

* New translations en.json (Sinhala)

* New translations en.json (Swahili)

* New translations en.json (Nepali)

* New translations en.json (Ogiek)

* New translations en.json (Spanish)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (German)

* New translations en.json (Japanese)

* New translations en.json (Mongolian)

* New translations en.json (Dutch)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Khmer)

* New translations en.json (Tamil)

* New translations en.json (Thai)

* New translations en.json (Burmese)

* New translations en.json (Sinhala)

* New translations en.json (Swahili)

* New translations en.json (Nepali)

* New translations en.json (Ogiek)

* New translations en.json (Spanish)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Spanish)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (German)

* New translations en.json (Japanese)

* New translations en.json (Mongolian)

* New translations en.json (Dutch)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Khmer)

* New translations en.json (Tamil)

* New translations en.json (Thai)

* New translations en.json (Burmese)

* New translations en.json (Sinhala)

* New translations en.json (Swahili)

* New translations en.json (Nepali)

* New translations en.json (Ogiek)

---------

Co-authored-by: Digidem Bot <[email protected]>

* feat: set preset language to match app language (#783) (#784)

* feat: set preset language to match app language

* feat: translate fields

* test: load env variables so `npm test` works locally (#742) (#790)

We [set environment variables in CI][0] so that `npm test` works, but it
doesn't work locally because Jest isn't loading them.

This loads them when running Jest.

[0]: https://github.com/digidem/comapeo-mobile/blob/9b6cf8f71a0d960174c7e8cd5ce1b6bb8f1dd5a7/.github/workflows/ci.yml#L72-L75

Co-authored-by: Evan Hahn <[email protected]>
Co-authored-by: Gregor MacLennan <[email protected]>

* test: update Jest to latest version, 29.7.0 (#781) (#791)

This updates `jest` and `@types/jest` to their latest versions.

Co-authored-by: Evan Hahn <[email protected]>

* fix: Fix changing preset & store `presetRef` on observation (#785) (#792)

* fix: Fix changing preset & store preset ref on observation

* fix: revert removed ts-expect-error

(my vscode was using a newer version of typescript to check this, leading me to think this was not needed)

* chore: improve code legibility of usePreset

* chore: add unit test for updatePreset

* fix: missing presetRef when first creating observation without photos

* fix: editing an observation was not correctly removing tags

Co-authored-by: Gregor MacLennan <[email protected]>

* New Crowdin updates (#780) (#793)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Spanish)

Co-authored-by: Digidem Bot <[email protected]>

* chore: take our background location permission

---------

Co-authored-by: ErikSin <[email protected]>
Co-authored-by: Evan Hahn <[email protected]>
Co-authored-by: cimigree <[email protected]>
Co-authored-by: Gregor MacLennan <[email protected]>
Co-authored-by: Andrew Chou <[email protected]>
Co-authored-by: Digidem Bot <[email protected]>
  • Loading branch information
7 people authored Oct 14, 2024
1 parent dfc7d9b commit f2ae1c7
Show file tree
Hide file tree
Showing 135 changed files with 17,615 additions and 6,837 deletions.
20 changes: 20 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Replace <replace_me> with the relevant values

## Used at build time

### Used for downloading the Mapbox Android SDK when building the native parts of the app
MAPBOX_DOWNLOAD_TOKEN=<replace_me>

## Used at run time

APP_VARIANT=development
MAPBOX_ACCESS_TOKEN=<replace_me>
COMAPEO_METRICS_URL=<replace_me>
COMAPEO_METRICS_API_KEY=<replace_me>

## Feature flags (can generally leave these commented out and uncomment when needed)

# EXPO_PUBLIC_FEATURE_TEST_DATA_UI=true
# EXPO_PUBLIC_FEATURE_MEDIA_MANAGER=true
# EXPO_PUBLIC_FEATURE_TRACKS=true
# EXPO_PUBLIC_FEATURE_AUDIO=true
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [main]
branches: [develop, 'release/**']
pull_request:
# By default, a workflow only runs when a pull_request's activity type is
# opened, synchronize, or reopened. Adding ready_for_review here ensures
Expand Down Expand Up @@ -69,3 +69,7 @@ jobs:
run: npm run lint:types
- name: Run unit tests
run: npm test
env:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
COMAPEO_METRICS_URL: ${{ secrets.COMAPEO_METRICS_URL }}
COMAPEO_METRICS_API_KEY: ${{ secrets.COMAPEO_METRICS_API_KEY }}
114 changes: 114 additions & 0 deletions .github/workflows/create-release-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Create Release Branch and Build RC

on:
workflow_dispatch:

jobs:
create-release-branch:
runs-on: ubuntu-latest

outputs:
version: ${{ steps.read_version.outputs.VERSION }}
branch_name: ${{ steps.read_version.outputs.BRANCH_NAME }}
commit_sha: ${{ steps.get_commit_sha.outputs.COMMIT_SHA }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: develop

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Read package.json version
id: read_version
run: |
version=$(node -p "require('./package.json').version")
major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f2)
patch=$(echo $version | cut -d. -f3 | cut -d- -f1)
new_version="${major}.${minor}.${patch}-RC.0"
branch_name="release/v${major}.${minor}.${patch}"
echo "VERSION=$new_version" >> $GITHUB_ENV
echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV
echo "::set-output name=VERSION::$new_version"
echo "::set-output name=BRANCH_NAME::$branch_name"
- name: Configure git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Create and push new branch
run: |
name=${{ env.BRANCH_NAME }}
echo "Creating and pushing new branch $name"
git checkout -b $name || { echo "ERROR: Branch creation failed"; exit 1; }
git push origin $name --force || { echo "ERROR: Push failed"; exit 1; }
- name: Get latest commit SHA
id: get_commit_sha
run: |
commit_sha=$(git rev-parse HEAD)
echo "Commit SHA: $commit_sha"
echo "COMMIT_SHA=$commit_sha" >> $GITHUB_ENV
echo "::set-output name=COMMIT_SHA::$commit_sha"
- name: Check if deploy branch exists
id: check_deploy_branch
run: |
if git ls-remote --exit-code --heads origin deploy; then
echo "Deploy branch exists."
echo "DEPLOY_BRANCH_EXISTS=true" >> $GITHUB_ENV
else
echo "Deploy branch does not exist."
echo "DEPLOY_BRANCH_EXISTS=false" >> $GITHUB_ENV
fi
- name: Create Pull Request to deploy
if: env.DEPLOY_BRANCH_EXISTS == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
new_version=${{ env.VERSION }}
branch_name=${{ env.BRANCH_NAME }}
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
-d "{\"title\":\"$branch_name\",\"body\":\"This PR is for the release of version $new_version\",\"head\":\"$branch_name\",\"base\":\"deploy\"}" \
https://api.github.com/repos/${{ github.repository }}/pulls
- name: Notify if deploy branch is missing
if: env.DEPLOY_BRANCH_EXISTS == 'false'
run: echo "The deploy branch does not exist. Please create it manually."

dispatch-eas-build:
runs-on: ubuntu-latest
needs: create-release-branch

steps:
- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO }}

- name: Checkout Release Branch
uses: actions/checkout@v3
with:
ref: ${{ needs.create-release-branch.outputs.branch_name }}

- name: 📦 Install dependencies
run: npm install

- name: Build Release Candidate APK
env:
COMMIT_SHA: ${{ needs.create-release-branch.outputs.commit_sha }}
VERSION: ${{ needs.create-release-branch.outputs.version }}
run: |
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "COMMIT_SHA=${COMMIT_SHA}" >> $GITHUB_ENV
eas build --platform android --profile release-candidate
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ The next version of Mapeo Mobile

- When setting up the Android-specific tooling, you will also need to install the [Android NDK](https://developer.android.com/ndk/). This can be installed using Android Studio by going to the `SDK Tools` tab in the `SDK Manager`. This project uses **NDK 25.1.8937393**.

3. Create a `.env` file at the root of the project with the following content:
3. Copy the [`.env.template`](./.env.template) file to a file called `.env`. Replace any placeholder `<replace_me>` values with the relevant ones:

```
MAPBOX_DOWNLOAD_TOKEN=<your_token_here>
EXPO_PUBLIC_METRICS_URL=<metrics URL>
EXPO_PUBLIC_METRICS_API_KEY=<metrics API key>
```
`MAPBOX_ACCESS_TOKEN`: a [Mapbox access token](https://docs.mapbox.com/android/maps/guides/install/#configure-credentials). If you do not have access to a Mapbox account, reach out to the maintainers about getting access to an access token.

`MAPBOX_DOWNLOAD_TOKEN`: a [Mapbox secret token](https://docs.mapbox.com/android/maps/guides/install/#configure-credentials). This is unfortunately required to install the necessary Mapbox Android SDK components used by `@rnmapbox/maps@10` when building the app (more info [here](https://github.com/rnmapbox/maps/blob/v10.0/android/install.md#mapbox-maps-sdk-v10)). If you do not have access to a Mapbox account, reach out to the maintainers about getting access to a secret token.

Replace `<your_token_here>` with a [Mapbox secret token](https://docs.mapbox.com/android/maps/guides/install/#configure-credentials). This is unfortunately required to install the necessary Mapbox Android SDK components used by `@rnmapbox/maps@10` when building the app (more info [here](https://github.com/rnmapbox/maps/blob/v10.0/android/install.md#mapbox-maps-sdk-v10)). If you do not have access to a Mapbox account, reach out to the maintainers about getting access to a secret token.
`COMAPEO_METRICS_URL`: URL pointing to a hosted CoMapeo metrics server. Reach out to the maintainers about getting access to this credential.
`COMAPEO_METRICS_API_KEY`: API key needed for accessing a CoMapeo metrics server. Reach out to the maintainers about getting access to this credential.

3. Run the app locally

Expand Down
62 changes: 51 additions & 11 deletions app.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,51 @@
const SUFFIX =
{development: '.dev', production: '', test: '.test'}[
process.env.APP_VARIANT
] ?? '';
const {execSync} = require('child_process');

const NAME =
{development: ' (DEV)', production: '', test: ' (TEST)'}[
process.env.APP_VARIANT
] ?? '';
const APP_VARIANT = process.env.APP_VARIANT;

/** @type {string} */
const APP_ID_SUFFIX =
{
development: '.dev',
production: '',
releaseCandidate: '.rc',
preRelease: '.pre',
}[APP_VARIANT] ?? '.dev';

/** @type {string} */
const APP_NAME_SUFFIX =
{
development: ' Dev',
production: '',
releaseCandidate: ' RC',
preRelease: ' Pre',
}[APP_VARIANT] ?? ' Dev';

const pkgVersion = require('./package.json').version;
const pkgVersionBase = pkgVersion.replace(/-.*/, '');

/** @type {string} */
let appVersionSuffix =
{
development: '-dev',
production: '',
releaseCandidate: '-rc',
preRelease: '-pre',
}[APP_VARIANT] ?? '-dev';

if (APP_VARIANT !== 'production') {
try {
// SHA of commit this version was built from
const commitSha =
process.env.EAS_BUILD_GIT_COMMIT_HASH ||
execSync('git rev-parse HEAD').toString().trim();
const commitShaShort = commitSha.slice(0, 7);
appVersionSuffix += `+${commitShaShort}`;
} catch (e) {
// Expo-doctor runs in a temp directory which is not a git repo, so this command will fail.
}
}

const versionName = `${pkgVersionBase}${appVersionSuffix}`;

/**
* @param {object} opts
Expand All @@ -16,20 +55,21 @@ const NAME =
*/
module.exports = ({config}) => ({
...config,
version: versionName,
extra: {
...config.extra,
eas: {
projectId: '2d5b8137-12ec-45aa-9c23-56b6a1c522b7',
},
},
name: 'CoMapeo' + NAME,
name: 'CoMapeo' + APP_NAME_SUFFIX,
ios: {
...config.ios,
bundleIdentifier: 'com.comapeo' + SUFFIX,
bundleIdentifier: 'com.comapeo' + APP_ID_SUFFIX,
},
android: {
...config.android,
package: 'com.comapeo' + SUFFIX,
package: 'com.comapeo' + APP_ID_SUFFIX,
googleServicesFile: process.env.GOOGLE_SERVICES_JSON,
},
updates: {
Expand Down
3 changes: 0 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"jsEngine": "hermes",
"name": "CoMapeo",
"slug": "comapeo",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
Expand Down Expand Up @@ -62,7 +61,6 @@
["./expo-config-plugins/targetArmArchsOnly.js"]
],
"android": {
"versionCode": 1,
"allowBackup": false,
"adaptiveIcon": {
"foregroundImage": "./assets/icon.png",
Expand All @@ -76,7 +74,6 @@
"permissions": [
"android.permission.ACCESS_COARSE_LOCATION",
"android.permission.ACCESS_FINE_LOCATION",
"android.permission.ACCESS_BACKGROUND_LOCATION",
"android.permission.FOREGROUND_SERVICE",
"android.permission.FOREGROUND_SERVICE_LOCATION",
"android.permission.CAMERA",
Expand Down
17 changes: 16 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
const assert = require('assert');

const requiredEnvVars = [
'MAPBOX_ACCESS_TOKEN',
'COMAPEO_METRICS_URL',
'COMAPEO_METRICS_API_KEY',
];

for (const requiredEnvVar of requiredEnvVars) {
assert(
process.env[requiredEnvVar],
`Missing required environment variable: ${requiredEnvVar}`,
);
}

module.exports = function (api) {
api.cache(true);
return {
//https://github.com/babel/babel/discussions/13676#discussioncomment-1183149
compact: true,
presets: ['babel-preset-expo'],
plugins: [
'transform-inline-environment-variables',
['transform-inline-environment-variables', {include: requiredEnvVars}],
// react-native-reanimated/plugin has to be last
'react-native-reanimated/plugin',
],
Expand Down
31 changes: 31 additions & 0 deletions docs/BuildAndPublishingFlows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build And Publishing Flow

### Background

This repo follows the develop/deploy git flow, where there are 2 main branches, `develop` and `deploy` which are used for keeping the production ready code and latest code seperate, but integrated. The `deploy` branch always reflects a production ready state, and is the code found in the apps being used by the general public. Any changes made to the `deploy` branch should be pushed out to the publicly released app. The `develop` branch reflects the codebase with the latest delivered development changes which are slated for the upcoming release. Any new features that have not been released but are ready to be QA'd can be found in this branch. More about this flow can be found [here](https://nvie.com/posts/a-successful-git-branching-model/).

We use [EAS](https://expo.dev/pricing) to build our app. There are different types of builds for several use cases

- Release Candidate: A Release Candidate is an APK that is used for internal testing and QA purposes. It reflects the next public release, and should be extensively tested.
- Production: A Production build is an .aab that is used by the google play store to distribute CoMapeo. A production build should have been extensively tested and reflects the latest changes found in the `deploy` branch.
- Pre: A pre build is an APK that is used for internal testing. It differs from a release candidate as it is typically not going to be used for a public release. This is most often used when there are features that want to be tested before they are ready to be QA's for an actual release

This repo uses github actions to dispatch the creation of these builds. See [How To](#how-to) for instruction on building.

### Versioning

CoMapeo uses [semantic versioning](https://semver.org/).

The `develop` branch will always be one `minor` version ahead of the released version and have the suffix "-pre". (eg, if the latest released version is 1.3.2, the `develop` branch version will be 1.4.0-pre).

### How To

## Release Candidate

A Release Candidate can be built directly in the action tab on the the github repo. Click on the action "Create Release Branch and Build RC". This will automatically create a Pull Request from the latest develop, with its base pointing to Deploy. As well, it will dispatch a build with EAS that will build a `Release Candidate` apk. The version of this build will be the version of develop, with `pre` being replaced with `RC.0` plus the SHA number of the latest commit. (Eg. If the develop version is `1.4.0-pre`, this Release Candidate will be `1.4.0-RC+{SHA#OfLatestCommit}').

## Production

A production AAB will automatically be built when a Branch created by the [ReleaseCandidate](#release-candidate) flow is merged into deploy. This will also increase the `minor` version of the develop branch

## Pre
Loading

0 comments on commit f2ae1c7

Please sign in to comment.