Compare commits

...

29 Commits

Author SHA1 Message Date
wunderfisch 31ccb22c82 better readability 2023-12-11 10:20:44 +00:00
wunderfisch ddfbc4cee8 reentered the merge part 2023-12-11 10:18:40 +00:00
wunderfisch 9d21138da7 Merge branch 'chore/contribution' into 'main'
suggestions to rewrite how to contribute

See merge request bloodyhealth/drip!634
2023-12-11 10:12:14 +00:00
bl00dymarie a6fc38ca47 Merge branch '674-chore-update-media-for-fdroid' into 'main'
Resolve "Chore: Update media for Fdroid"

Closes #674

See merge request bloodyhealth/drip!635
2023-12-05 15:08:28 +00:00
bl00dymarie 2f07b76b6c improved text how to contribute to drip 2023-12-05 12:28:17 +00:00
bl00dymarie bb29f29de5 Update file Default.md 2023-12-04 19:36:39 +00:00
bl00dymarie b39a5681ea Chore: Add new screenshots (sharepics) 2023-12-04 20:23:30 +01:00
bl00dymarie 38a56b0fbd Chore: Remove outdated screenshots 2023-12-04 20:22:40 +01:00
bl00dymarie c5906c2144 Update file RELEASE.md 2023-12-04 15:08:31 +00:00
bl00dymarie 89015abe17 Update file RELEASE.md 2023-12-04 15:07:57 +00:00
bl00dymarie 06fc4f4b6b Update file RELEASE.md 2023-12-04 15:07:04 +00:00
bl00dymarie 64ed3aba4a Update file RELEASE.md 2023-12-04 15:03:16 +00:00
wunderfisch 5a18593ab5 improvements of explanation how to run the android app on a virtual device 2023-12-04 11:34:46 +00:00
wunderfisch 3755ac8ac9 suggestions to rewrite how to contribute 2023-11-29 18:15:23 +01:00
bl00dymarie d6dbea78ac Merge branch 'Chore/Release-steps' into 'main'
Chore: Android release documentation

See merge request bloodyhealth/drip!631
2023-11-22 15:29:06 +00:00
wunderfisch 84ff76096b Implement review feedback 2023-11-22 14:53:57 +00:00
bl00dymarie e030c4d75e Update download badges 2023-11-21 13:16:26 +00:00
bl00dymarie 4ed399c50c Add toc, screenshot info and some more 2023-11-20 18:04:41 +01:00
bl00dymarie 92546362a0 Chore: document release process for android 2023-11-18 00:34:50 +01:00
bl00dymarie 486dd185e2 Remove automatic changelog update 2023-11-18 00:34:44 +01:00
bl00dymarie e576c5dc7d Rename master to main in documentation 2023-11-18 00:34:38 +01:00
bl00dymarie 536106f757 Merge branch 'release' into 'main'
Keep main up to date with release branch after android v1.2311.14 Google Play Publish

See merge request bloodyhealth/drip!630
2023-11-17 23:29:48 +00:00
bl00dymarie 552e63c9ef Merge branch 'chore/ci-cd' into 'main'
Chore: Bump npm version

See merge request bloodyhealth/drip!624
2023-11-17 13:13:10 +00:00
Liv M 9dff2808c0 Chore: Bump npm version 2023-11-17 13:13:10 +00:00
tintenfisch c432edbbaf Merge branch '645-chore-update-readme-for-android' into 'main'
updated readme for android

Closes #645

See merge request bloodyhealth/drip!617
2023-11-09 10:04:34 +00:00
bl00dymarie 67d58e3db4 Update 2 files
- /.gitlab/issue_templates/bug-template.md
- /.gitlab/issue_templates/chore-template.md
2023-11-09 09:55:01 +00:00
wunderfisch 773f1c86c2 added link to adb website 2023-11-07 11:26:00 +01:00
bl00dymarie 3f2af788f3 Apply reviewed suggestions 2023-11-07 10:20:12 +00:00
wunderfisch 4139cba63c updated readme after checking on two different ubuntu devices 2023-11-06 15:15:05 +01:00
28 changed files with 194 additions and 131 deletions
+1
View File
@@ -8,6 +8,7 @@ cache:
test_async:
script:
- npm install npm@7.0.1 -g
- npm install
- npm test
+2 -2
View File
@@ -6,8 +6,8 @@ Short overview how the bug manifests.
### which OS + version is your device
[ ] Android _number_
[ ] iOS _number_
- [ ] Android _number_
- [ ] iOS _number_
### which drip version number are you using
+5 -5
View File
@@ -6,16 +6,16 @@ Short overview
### is it urgent? ⏳
[ ] Yes
[ ] No
[ ] something in between
- [ ] Yes
- [ ] No
- [ ] something in between
_Explain the urgency if possible, e.g. is it a security vulnerability for potentially everyone?_
### which OS
[ ] Android
[ ] iOS
- [ ] Android
- [ ] iOS
### what shall be the ideal outcome 🎆
@@ -1,7 +1,5 @@
## Why this change?
Closes #
## Description
I have tested this MR:
+22 -23
View File
@@ -1,10 +1,10 @@
# Contributing to drip aka CONDRIPUTING
So good to see you here, hello :wave\_tone1: :wave\_tone2: :wave\_tone3: :wave\_tone4: :wave\_tone5:
So good to see you here, hello :wave_tone1: :wave_tone2: :wave_tone3: :wave_tone4: :wave_tone5:
## Table Of Contents
[TL;DR](#tl-dr)
[TL;DR](#tldr)
[What should I know before I get started?](#what-should-i-know-before-i-get-started)
@@ -14,45 +14,44 @@ So good to see you here, hello :wave\_tone1: :wave\_tone2: :wave\_tone3: :wave\_
## TL;DR
You just want to say hello? Send us a [nice email](mailto:drip@mailbox.org?Subject=Nice%20incoming%20mail) :postbox:, ask to [join our Slack](mailto:drip@mailbox.org?Subject=Join%20Slack) or tweet :bird: at us [@dripberlin](https://twitter.com/dripberlin).
You just want to say hello? Send us a [nice email](mailto:drip@mailbox.org?Subject=Nice%20incoming%20mail) :postbox:, toot :mammoth: [@dripapp@mastodon.social](https://mastodon.social/@dripapp) or tweet :bird: at us [@dripberlin](https://twitter.com/dripberlin).
## What should I know before I get started?
We have prepared something for **you**: check out our [README](https://gitlab.com/bloodyhealth/drip/blob/master/README.md) for more information on how to set up and install everything you'll need.
[Ping us](mailto:drip@mailbox.org) if you could need some help :helmet\_with\_cross: !
We have prepared something for **you**: check out our [README](https://gitlab.com/bloodyhealth/drip/blob/main/README.md) for more information on how to set up and install everything you'll need.
[Ping us](mailto:drip@mailbox.org) if you could need some help :helmet_with_cross: !
Let us know if you want to suggest improvements for the README and open a merge request (which is just like Github's pull request)
## How can I condripute?
### Your First Code Condripution
We are an open source project and we highly appreciate contributions. At the same time please keep some things in mind: :heart:
We are fans of labels, at least for our issues. You can find a list of `newbie` issues [here](https://gitlab.com/bloodyhealth/drip/issues?label_name%5B%5D=Newbie).
If you decide to work on an issue, please click on `Create branch` based on that issue. You can find this as a dropdown option right under `Create merge request`.
This allows us to keep track of the issues that are related to an existing branch and tells everyone "somebody is working on it".
- The drip maintainers are usually around 2-3 people and are responsible for everything from developing new features to answering press inquiries or fixing bugs. Most of this work is done unpaid. (If you write a nice email your chances to get an answer are much higher than if you behave like a tech bro.)
- We have a plan for the direction in which drip should evolve. This means that even if it isn't always transparent on gitlab, we have a list of features that we are building and more importantly, which bugs need to be fixed and which dependencies need to be updated.
- drips core values are:
- 🔮 open source
- 🩸 feminist and gender inclusive
- 🔒 secure: data entered stays with that person/on their device
- 🔬 science based: we implemented the symptothermal method
If you want to open a merge request, yeah :tada: exciting! We are using a template for merge requests to make sure we explain what we have done and why.
Keep in mind that people who will review your merge request are more motivated to do so when the merge request is well explained and ideally not too big.
This means that we will never implement anything that contradicts these core values. Some examples: We will never build a cloud integration, we will never make an ovulation prediction.
- If you would like to make a sustainable contribution to the project, we would be happy to join the game.
### Reporting Bugs
### Reporting Bugs or Making Suggestions
You found a bug :bug:? Please feel free to investigate and save logs for more specific details.
If you found a bug or have suggestions, please :one: first review the [list of existing issues](https://gitlab.com/bloodyhealth/drip/issues) to make sure the bug/suggestion is unknown; :two: after that, take time to investigate and write a detailed issue report. Best you use our [templates for bug /chore/ feature](https://gitlab.com/bloodyhealth/drip/-/tree/main/.gitlab/issue_templates) (you can choose when creating a new issue) in gitlab or send us an email to our [gitlab email](mailto:incoming+bloodyhealth/drip@incoming.gitlab.com). It will automagically add a new issue to the list with a description text taken from the body of your email. Please attach screenshots or other helpful things.
Before creating a new issue, please review the [list of existing issues](https://gitlab.com/bloodyhealth/drip/issues) to make sure the bug is unknown. You are invited to describe the bug in all its details e.g. in what context/settings has it occurred?
### Your First Condripution
To send us a new issue you can also use our [gitlab email](mailto:incoming+bloodyhealth/drip@incoming.gitlab.com). It will automagically add a new issue to the list with a description text taken from the body of your email.
- If you want to contribute to drip's code or translation, please get in touch with us. We can tell you if someone is already working on something similar, if your idea does (not) match drip's core values, etc. Of course, you can always create a drip version for your private use with anything you want, but please don't expect us to review and merge code that has not been discussed before.
- If you want to open a merge request, yeah :tada: exciting! We are using a template for merge requests to make sure we explain what we have done and why.
- Keep in mind that people who will review your merge request are more motivated to do so when the merge request is well explained and ideally not too big.
### Suggesting Enhancements
Do you have suggestions for enhancing the app or for cleaning up some code? Fantastic!
Before creating a new issue, please review the [list of existing issues](https://gitlab.com/bloodyhealth/drip/issues) to make sure nobody else had the same idea before you! You are then invited to open a new issue with a somewhat extensive description, you can use emojis or GIFs if it helps :)!
To send us a new issue you can also use our [gitlab email](mailto:incoming+bloodyhealth/drip@incoming.gitlab.com). It will automagically add a new issue to the list with the title taken from the subject line and the description text for the issue taken from the body of your email.
### Thank you
![](https://media.giphy.com/media/kPA88elN9kYco/giphy.gif)
Thank you for condriputing to open source, thank you for condriputing to drip!
Much love from Bloody Health :heart\_exclamation:
Much love from Bloody Health :heart_exclamation:
+46 -18
View File
@@ -5,19 +5,22 @@ Find more information on [our website](https://dripapp.org/).
[<img src="https://dripapp.org/assets/get.png"
alt="Get it here"
height="55">](https://dripapp.org/release/8.apk)
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/com.drip/)
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
height="55">](https://dripapp.org/release/v1.2311.14.apk)
[<img src="https://dripapp.org/assets/badge_google-play.png"
alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=com.drip)
height="55">](https://dripapp.org/android)
[<img src="https://dripapp.org/assets/badge_app-store.png"
alt="Get drip on the App Store"
height="55">](https://dripapp.org/ios)
[<img src="https://dripapp.org/assets/badge_f-droid.png"
alt="Get it on F-Droid"
height="55">](https://dripapp.org/fdroid)
The app is built in React Native and currently developed for Android.
The app is built in React Native and developed for Android and iOS.
▶ [How to contribute to the project](https://gitlab.com/bloodyhealth/drip/blob/master/CONTRIBUTING.md)
▶ [How to contribute to the project](https://gitlab.com/bloodyhealth/drip/blob/main/CONTRIBUTING.md)
▶ [How to release a new version](https://gitlab.com/bloodyhealth/drip/blob/master/RELEASE.md)
▶ [How to release a new version](https://gitlab.com/bloodyhealth/drip/blob/main/RELEASE.md)
## Development setup
@@ -33,14 +36,14 @@ or clone it with HTTPS
### 2. Node & yarn version
Make sure you are running Node 14 and classic yarn (v.1). It's easiest to switch Node versions using `nvm`, here's how to install NVM: https://github.com/nvm-sh/nvm#installing-and-updating. Once you have nvm you can install node 14:
Make sure you are running Node 14 and classic yarn (v.1). It's easiest to switch Node versions using `nvm`, here's how to install NVM: https://github.com/nvm-sh/nvm#installing-and-updating. After installing nvm close the terminal and open it again to be able to use nvm.
Once you have nvm running you can install node 14:
nvm install v14.19.3
and then run
use npm to install yarn:
cd drip
yarn install
npm install --global yarn
## for Android
@@ -50,13 +53,34 @@ Install [Android Studio](https://developer.android.com/studio/) - you'll need it
### 3.2 More requirements from Android Studio
Open Android Studio and click on "Open an existing Android Studio project". Navigate to the drip repository you cloned and double click the android folder. It detects, downloads and cofigures requirements that might be missing, like the NDK and CMake to build the native code part of the project.
Open Android Studio. If the message "SDK location not found" appears when you try to start it, edit `.bashrc` in your home directory by adding:
export ANDROID_SDK_ROOT="$HOME/Android/Sdk"
Check by typing in your terminal:
echo $ANDROID_SDK_ROOT
You should see the path of Sdk.
If you haven't installed [adb tools](https://developer.android.com/tools/adb) before, you will also have to do so and add to the .bashrc
PATH="$PATH:$HOME/Android/Sdk/platform-tools"
In Android Studio click on "Open an existing Android Studio project". Navigate to the drip repository you cloned and double click the android folder. It detects, downloads and cofigures requirements that might be missing, like the NDK and CMake to build the native code part of the project.
### 3.3 Run the app on Android
Either start a [virtual device in Android Studio](https://developer.android.com/studio/run/emulator) or [set your physical device like your Android phone up](https://developer.android.com/training/basics/firstapp/running-app) to run the app.
Either create and start a [virtual device in Android Studio](https://developer.android.com/studio/run/emulator) or [set your physical device like your Android phone up](https://developer.android.com/training/basics/firstapp/running-app) to run the app.
i. Open a terminal and run
i. Open a terminal, navigate to the drip folder and run
yarn install
In a separate tab, that needs to keep running as long as you want to keep the app connected, run
yarn start
Also run in a new tab
yarn android
@@ -64,7 +88,11 @@ ii. To see logging output, run the following command in another tab:
yarn log
iii. Run the following command and select enable hot reloading (see https://facebook.github.io/react-native/docs/debugging.html):
iii. If you had an older version of drip before and you are now trying to run a new drip version, clear cache by running
yarn clear
iv. Run the following command and select enable hot reloading (see https://facebook.github.io/react-native/docs/debugging.html):
adb shell input keyevent 82
@@ -147,7 +175,7 @@ You can run the tests with:
### End to end tests
1. Check what testing device is specified in [package.json](https://gitlab.com/bloodyhealth/drip/blob/master/package.json) under:
1. Check what testing device is specified in [package.json](https://gitlab.com/bloodyhealth/drip/blob/main/package.json) under:
```
{"detox":
{"configurations":
+96 -21
View File
@@ -1,33 +1,108 @@
# How to release a new version
# How to release a new app version for Android
Note: You need the release-key to bundle a release that can be uploaded to Google Play Store.
_Note: You need the release-key for Android to bundle a signed release that can be uploaded and published via the Google Play Store. A similar process for Apple requires a certificate to upload and publish the app to the App Store. More documentation on 'How to release a new app version for iOS' coming soon._
Run the release wizard that takes you through all the steps necessary to prepare a new release:
# Table of Contents
1. [version updating](#Version-updating)
2. [android building](#Building-in-Android)
- [APK](#APK)
- [AAB](#AAB)
3. [release sharing](#Share-the-release)
## Version updating
When you are done with a chore, a feature or a bugfix, you may want to share it with testers and eventually publish a release. In order to identify a specific app version we can update the version name, which is created based on the following format: `1.yymm.d` e.g. `1.2311.7`. If you want to upload a new app version to Google Play you also need to update the version code.
The following command will:
- create a new versionName and a new higher versionCode (+1)
- create a commit including a tag named after the new release version name.
```
npm run release
```
This will trigger the following:
* update version number
* create a new tag for the release
* update the changelog
* make a release commit
To then bundle a release run the following command on your branch:
```
cd android && ./gradlew bundleRelease
yarn release
```
This command creates an `app.aab` file in the folder `/android/app/build/outputs/bundle/release`.
The versionName and versionCode [are defined here](https://gitlab.com/bloodyhealth/drip/-/blob/5401789c46f4a02915ab900ef284581be420451c/android/app/build.gradle#L137-138) and in [package.json](https://gitlab.com/bloodyhealth/drip/-/blob/5401789c46f4a02915ab900ef284581be420451c/package.json#L3).
[More on Android App Bundle](https://blog.swmansion.com/make-your-react-native-app-3x-smaller-44c993eda2c9)
## Building in Android
You need to manually push the created tag to Gitlab:
APK versus AAB
> Android App Bundles (AAB) include all your apps compiled code and resources, but defer APK generation and signing to Google Play. Unlike an APK, you can't deploy an app bundle directly to a device. So, if you want to quickly test or share an APK with someone else, you should instead build an APK.
(https://developer.android.com/build/building-cmdline)
### APK
To build a release apk file, run the following command:
```
git push origin <tagname>
yarn build-android-apk-release
```
Also don't forget to push your branch to Gitlab and review and merge it if ready!
Yay, done (have a scoop of ice cream, I suggest coconut 🍦)!
_which is a shortcut for:_ `cd android && ./gradlew clean && ./gradlew assembleRelease && cd ..`
This will create a new apk file named `app-release.apk` under `./android/app/build/outputs/apk/release/`.
For signing an apk you can run this command:
```
yarn sign-android-apk-release
```
_which is a shortcut for:_ `zipalign -v -p 4 ./android/app/build/outputs/apk/release/app-release.apk ./android/app/build/outputs/apk/release/app-release_signed.apk`
It adds a file name `app-release_signed.apk` in the same folder in `./android/app/build/outputs/apk/release/`
### AAB
To build a release aab file, run:
```
yarn build-android-aab-release
```
_which is a shortcut for:_ `cd android && ./gradlew clean && ./gradlew :app:bundleRelease && cd ..`
It creates a new aab file named `app-release.aab` under `./android/app/build/outputs/bundle/release`
For signing an aab you first need to configure the base modules build.gradle file with your apps signing information. You can then run this command:
```
yarn sign-android-aab-release
```
_which is a shortcut for:_ `jarsigner -keystore ./android/app/drip-release-key.keystore ./android/app/build/outputs/bundle/release/app-release.aab drip-release-key`
## Share the release
### Gitlab repository
For a quick and easy way to share an apk to testers who are willing to sideload drip onto their Android phones, do this: Upload a signed apk to the Gitlab repository of the drip website under `/release` https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/tree/main/release and maybe adapt the name of the apk with a more specific name than "app-release.apk". Now you can simply share a direct link to download your newly bundled apk, e.g. [a download link for v1.2311.14](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/blob/main/release/v1.2311.14.apk).
### Google Play Console
Upload a signed aab to the [Google Play Console for developers](https://play.google.com/console/) and add it to the "App bundle explorer". This requires a higher versionCode and a different version name compared to previously uploaded aab or apk files.
You can decide if you want the new app version to get released for testing (internal, closed or open) or for production. Keep in mind that any track other than "internal testing" triggers an external review by Google and might take a few hours.
#### Phone screenshots
If there are visual changes in the app you may want to update the screenshots for the Google Play Store listing. Keep in mind that Google Play has specific resolution requirements. You'll find them in Grow -> Store presence -> Main Store Listing -> Phone screenshots.
### drip website
After a new version has been published on Google Play (or F-Droid) the apk version that is downloadable directly from the [drip website](https://dripapp.org) needs to get updated as well. Therefore you upload a signed apk to the [repository](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/) and adapt the name and link on /index.html.
Last time I checked it was [here](f3da9776b1943ffa32458e74ef86eeca98c1891c/index.html#L114).
#### Phone screenshots
Please also update [phone screenshots here](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/tree/main/assets) and set links on [/index](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/blob/f3da9776b1943ffa32458e74ef86eeca98c1891c/index.html#L47) and [/media](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/blob/c7f999bb7ad736345321537cbffa3f4c24eeee6d/media.html#L33) that can then also be attached to a social media post.
You probably want to share the app update by posting on one or more of these platforms:
- [Twitter](twitter.com/dripberlin)
- [Mastodon](mastodon.social/@dripapp)
- [Ko-fi](https://ko-fi.com/dripapp)
- [Linkedin](https://www.linkedin.com/company/34899684/)
- Different tech, privacy, feminist oriented slacks
Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

+4 -2
View File
@@ -18,11 +18,13 @@
"test-watch": "jest --watch test",
"lint": "eslint components lib test styles db",
"devtool": "adb shell input keyevent 82",
"build-android-release": "cd android && ./gradlew clean && ./gradlew assembleRelease && cd ..",
"build-android-apk-release": "cd android && ./gradlew clean && ./gradlew assembleRelease && cd ..",
"sign-android-apk-release": "zipalign -v -p 4 ./android/app/build/outputs/apk/release/app-release.apk ./android/app/build/outputs/apk/release/app-release_signed.apk",
"build-android-aab-release": "cd android && ./gradlew clean && ./gradlew :app:bundleRelease && cd ..",
"sign-android-aab-release": "jarsigner -keystore ./android/app/drip-release-key.keystore ./android/app/build/outputs/bundle/release/app-release.aab drip-release-key",
"update-version": "node ./tools/bin/update-version.js",
"commit-release": "node ./tools/bin/commit-release.js",
"tag-release": "node ./tools/bin/tag-release.js",
"update-changelog": "node ./tools/bin/update-changelog.js",
"release": "node ./tools/release-wizard.js",
"clear": ". scripts/clear.sh",
"postinstall": "npx jetify",
-12
View File
@@ -1,12 +0,0 @@
#!/usr/bin/env node
const updateChangelog = require('../update-changelog');
(async () => {
try {
await updateChangelog()
} catch(err) {
console.error(err)
process.exit(1)
}
})()
+3 -16
View File
@@ -1,7 +1,6 @@
const readline = require('readline')
const updateVersion = require('./update-version')
const createTagForRelease = require('./tag-release')
const updateChangelog = require('./update-changelog')
const makeCommitRelease = require('./commit-release')
process.on('unhandledRejection', err => { throw(err) })
@@ -16,24 +15,12 @@ async function leadThroughRelease() {
input: process.stdin,
output: process.stdout,
})
const shouldUpdateChangelog = await new Promise(resolve => {
rl.question('Would you like to update the changelog (y/n)?', yn => {
yn === 'y' || yn === 'Y' ? resolve(true) : resolve(false)
})
})
if (shouldUpdateChangelog) {
await updateChangelog()
await new Promise(resolve => {
rl.question("Awesome. We've added all commits for this release to the changelog file. Please review, edit and summarize where necessary so it's useful for the app's users. Then come back here and press enter.", () => resolve())
})
}
await makeCommitRelease()
console.log(`Groovy. We've created a commit for this release that includes the version and changelog updates, as well as a git tag for the release.
Please review it, make any necessary changes, and if it's all good, push the commit and the tag up to master by running:
git push origin master
console.log(`Groovy. We've created a commit for this release that includes the version, as well as a git tag for the release.
Please review it, make any necessary changes, and if it's all good, push the commit and the tag up to 'your-branch' by running:
git push origin 'your-branch'
git push origin ${require('../package.json').version}
Don't forget to also run 'npm run build-android-release' to package the apk and upload it to the app stores!
-19
View File
@@ -1,19 +0,0 @@
const updateChangelog = require('basic-changelog')
const opts = {
filterCommitsStartingWith: ['release:']
}
module.exports = () => {
return new Promise((resolve, reject) => {
updateChangelog('./CHANGELOG.md', opts, err => {
if (err) {
console.error('Something went wrong trying to update the changelog:')
reject(err)
return
}
console.log('Changelog successfully updated')
resolve()
})
})
}
+13 -9
View File
@@ -10,14 +10,16 @@ const fs = require('fs')
module.exports = () => {
return new Promise((resolve, reject) => {
const currentVersion = JSON.parse(fs.readFileSync('./package.json')).version
const currentVersionName = JSON.parse(
fs.readFileSync('./package.json')
).version
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
function createTodaysVersion(attempt) {
function createTodaysVersionName(attempt) {
const today = new Date()
const yy = today.getFullYear() - 2000 // So it's two digits
const monthString = (today.getMonth() + 1).toString()
@@ -31,18 +33,20 @@ module.exports = () => {
}
}
let nextVersion
let nextVersionName
for (let i = 0 /* letter a */; i <= 25 /* letter z */; i++) {
nextVersion = createTodaysVersion(i)
if (nextVersion !== currentVersion) break
nextVersionName = createTodaysVersionName(i)
if (nextVersionName !== currentVersionName) break
}
if (nextVersion === currentVersion) {
console.error('I dont know what else to generate beyond ' + nextVersion)
if (nextVersionName === currentVersionName) {
console.error(
'I dont know what else to generate beyond ' + nextVersionName
)
process.exit(1)
}
rl.question(
'Next version will be `' + nextVersion + '`, okay? y/n ',
'Next version name will be `' + nextVersionName + '`, okay? y/n ',
async (yn) => {
if (yn !== 'y' && yn !== 'Y') {
reject('Release cancelled.\n')
@@ -50,7 +54,7 @@ module.exports = () => {
}
const pkgJSON = JSON.parse(fs.readFileSync('./package.json'))
pkgJSON.version = nextVersion
pkgJSON.version = nextVersionName
fs.writeFileSync('./package.json', JSON.stringify(pkgJSON, null, 2))
await ReactNativeVersion.version(