Skip to content

Instantly share code, notes, and snippets.

@mochadwi
Last active April 5, 2020 04:58
Show Gist options
  • Select an option

  • Save mochadwi/5ea5d14ea0f906dc0a376e362cc6ff5f to your computer and use it in GitHub Desktop.

Select an option

Save mochadwi/5ea5d14ea0f906dc0a376e362cc6ff5f to your computer and use it in GitHub Desktop.

Revisions

  1. mochadwi revised this gist Apr 5, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions release_script.sh
    Original file line number Diff line number Diff line change
    @@ -24,11 +24,11 @@ export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}

    # 03a. (BETA RELEASE) checkout & annotate with git tag
    git checkout -b release/${VERSION_NAME}
    git tag -a beta/$VERSION_NAME -m "beta release to play store for ${VERSION_NAME} (${VERSION_CODE})"
    git tag -a $VERSION_NAME -m "beta release to play store for ${VERSION_NAME} (${VERSION_CODE})"

    # 03b. (HOTFIX RELEASE) checkout & annotate with git tag
    git checkout -b hotfix/${VERSION_NAME}
    git tag -a hotfix/$VERSION_NAME -m "hotfix release to play store for ${VERSION_NAME} (${VERSION_CODE})"
    git tag -a $VERSION_NAME -m "hotfix release to play store for ${VERSION_NAME} (${VERSION_CODE})"

    # 04. git add modified gradle file + git push new branch & tag
    git add ${MODULE_NAME}/${BUILD_GRADLE_FILE}
  2. mochadwi revised this gist Apr 5, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions release_script.sh
    Original file line number Diff line number Diff line change
    @@ -35,11 +35,11 @@ git add ${MODULE_NAME}/${BUILD_GRADLE_FILE}

    # 04a. commit+push for beta release
    git commit -m "beta release to play store for ${VERSION_NAME} (${VERSION_CODE})"
    git push -u origin release/${VERSION_NAME} && git push origin beta/${VERSION_NAME}
    git push -u origin release/${VERSION_NAME} && git push origin ${VERSION_NAME}

    # 04b. commit+push for hotfix release
    git commit -m "hotfix release to play store for ${VERSION_NAME} (${VERSION_CODE})"
    git push -u origin hotfix/${VERSION_NAME} && git push origin hotfix/${VERSION_NAME}
    git push -u origin hotfix/${VERSION_NAME} && git push origin ${VERSION_NAME}

    # 05. auto-publish the AAB
    # ./gradlew publishProdReleaseBundle --track=$TRACK --user-fraction=$USER_FRACTION
  3. mochadwi revised this gist Apr 5, 2020. 1 changed file with 12 additions and 2 deletions.
    14 changes: 12 additions & 2 deletions release_script.sh
    Original file line number Diff line number Diff line change
    @@ -22,14 +22,24 @@ export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}
    # 02. check for the information (receive user input)
    # git ls/info || git status

    # 03. checkout & annotate with git tag
    # 03a. (BETA RELEASE) checkout & annotate with git tag
    git checkout -b release/${VERSION_NAME}
    git tag -a beta/$VERSION_NAME -m "beta release to play store for ${VERSION_NAME} (${VERSION_CODE})"

    # 03b. (HOTFIX RELEASE) checkout & annotate with git tag
    git checkout -b hotfix/${VERSION_NAME}
    git tag -a hotfix/$VERSION_NAME -m "hotfix release to play store for ${VERSION_NAME} (${VERSION_CODE})"

    # 04. git add modified gradle file + git push new branch & tag
    git add ${MODULE_NAME}/${BUILD_GRADLE_FILE}

    # 04a. commit+push for beta release
    git commit -m "beta release to play store for ${VERSION_NAME} (${VERSION_CODE})"
    git push -u origin release/${VERSION_NAME} && git push origin ${VERSION_NAME}
    git push -u origin release/${VERSION_NAME} && git push origin beta/${VERSION_NAME}

    # 04b. commit+push for hotfix release
    git commit -m "hotfix release to play store for ${VERSION_NAME} (${VERSION_CODE})"
    git push -u origin hotfix/${VERSION_NAME} && git push origin hotfix/${VERSION_NAME}

    # 05. auto-publish the AAB
    # ./gradlew publishProdReleaseBundle --track=$TRACK --user-fraction=$USER_FRACTION
  4. mochadwi revised this gist Apr 2, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion release_script.sh
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ if [ "$#" -lt 1 ]; then
    fi

    export VERSION_NAME=`egrep '^[[:blank:]]+versionName[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $3}' | sed s/\"//g`
    export VERSION_CODE=`egrep '^[[:blank:]]+versionName[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $3}' | sed s/\"//g`
    export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $3}' | sed s/\"//g`

    # 01. bumper versionCode & versionName with gradle task

  5. mochadwi revised this gist Apr 2, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion release_script.sh
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ if [ "$#" -lt 1 ]; then
    fi

    export VERSION_NAME=`egrep '^[[:blank:]]+versionName[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $3}' | sed s/\"//g`
    export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $3}'`
    export VERSION_CODE=`egrep '^[[:blank:]]+versionName[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $3}' | sed s/\"//g`

    # 01. bumper versionCode & versionName with gradle task

  6. mochadwi revised this gist Apr 2, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions release_script.sh
    Original file line number Diff line number Diff line change
    @@ -14,8 +14,8 @@ if [ "$#" -lt 1 ]; then
    exit
    fi

    export VERSION_NAME=`egrep '^[[:blank:]]+versionName[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $2}' | sed s/\"//g`
    export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $2}'`
    export VERSION_NAME=`egrep '^[[:blank:]]+versionName[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $3}' | sed s/\"//g`
    export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $3}'`

    # 01. bumper versionCode & versionName with gradle task

  7. mochadwi revised this gist Apr 2, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion release_script.sh
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}

    # 03. checkout & annotate with git tag
    git checkout -b release/${VERSION_NAME}
    git tag -a $VERSION_NAME -m "beta release to play store for ${VERSION_NAME} (${VERSION_CODE})"
    git tag -a beta/$VERSION_NAME -m "beta release to play store for ${VERSION_NAME} (${VERSION_CODE})"

    # 04. git add modified gradle file + git push new branch & tag
    git add ${MODULE_NAME}/${BUILD_GRADLE_FILE}
  8. mochadwi revised this gist Jan 30, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions release_script.sh
    Original file line number Diff line number Diff line change
    @@ -24,11 +24,11 @@ export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}

    # 03. checkout & annotate with git tag
    git checkout -b release/${VERSION_NAME}
    git tag -a $VERSION_NAME -m "release for ${VERSION_NAME} (${VERSION_CODE})"
    git tag -a $VERSION_NAME -m "beta release to play store for ${VERSION_NAME} (${VERSION_CODE})"

    # 04. git add modified gradle file + git push new branch & tag
    git add ${MODULE_NAME}/${BUILD_GRADLE_FILE}
    git commit -m "release for ${VERSION_NAME} (${VERSION_CODE})"
    git commit -m "beta release to play store for ${VERSION_NAME} (${VERSION_CODE})"
    git push -u origin release/${VERSION_NAME} && git push origin ${VERSION_NAME}

    # 05. auto-publish the AAB
  9. mochadwi revised this gist Jan 30, 2020. 2 changed files with 3 additions and 3 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    - Use git-flow as branching model

    ### Notes
    - Change `$VERSION_NAME`, `$BUILD_GRADLE_FILE` & `$MODULE_NAME` accordingly to your needs
    - Change `$VERSION_NAME`, `$VERSION_CODE`, `$BUILD_GRADLE_FILE` & `$MODULE_NAME` accordingly to your needs
    - `VERSION_NAME="vX.Y.Z"`

    ### How to
    4 changes: 2 additions & 2 deletions release_script.sh
    Original file line number Diff line number Diff line change
    @@ -24,11 +24,11 @@ export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}

    # 03. checkout & annotate with git tag
    git checkout -b release/${VERSION_NAME}
    git tag -a $VERSION_NAME -m "release for ${VERSION_NAME}"
    git tag -a $VERSION_NAME -m "release for ${VERSION_NAME} (${VERSION_CODE})"

    # 04. git add modified gradle file + git push new branch & tag
    git add ${MODULE_NAME}/${BUILD_GRADLE_FILE}
    git commit -m "release for ${VERSION_NAME}"
    git commit -m "release for ${VERSION_NAME} (${VERSION_CODE})"
    git push -u origin release/${VERSION_NAME} && git push origin ${VERSION_NAME}

    # 05. auto-publish the AAB
  10. mochadwi revised this gist Jan 28, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion release_script.sh
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ git tag -a $VERSION_NAME -m "release for ${VERSION_NAME}"
    # 04. git add modified gradle file + git push new branch & tag
    git add ${MODULE_NAME}/${BUILD_GRADLE_FILE}
    git commit -m "release for ${VERSION_NAME}"
    git push -u origin release/v${VERSION_NAME} && git push origin ${VERSION_NAME}
    git push -u origin release/${VERSION_NAME} && git push origin ${VERSION_NAME}

    # 05. auto-publish the AAB
    # ./gradlew publishProdReleaseBundle --track=$TRACK --user-fraction=$USER_FRACTION
  11. mochadwi revised this gist Jan 28, 2020. 2 changed files with 3 additions and 2 deletions.
    3 changes: 2 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@
    - Use git-flow as branching model

    ### Notes
    - Change `$BUILD_GRADLE_FILE` & `$MODULE_NAME` accordingly to your needs
    - Change `$VERSION_NAME`, `$BUILD_GRADLE_FILE` & `$MODULE_NAME` accordingly to your needs
    - `VERSION_NAME="vX.Y.Z"`

    ### How to
    - Run this: `curl -s -L https://git.io/JedBV | bash`
    2 changes: 1 addition & 1 deletion release_script.sh
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}
    # git ls/info || git status

    # 03. checkout & annotate with git tag
    git checkout -b release/v${VERSION_NAME}
    git checkout -b release/${VERSION_NAME}
    git tag -a $VERSION_NAME -m "release for ${VERSION_NAME}"

    # 04. git add modified gradle file + git push new branch & tag
  12. mochadwi revised this gist Dec 21, 2019. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions release_script.sh
    Original file line number Diff line number Diff line change
    @@ -9,8 +9,8 @@ USER_FRACTION=$2

    if [ "$#" -lt 1 ]; then
    echo "Illegal number of parameters - required"
    echo "1. --track e.g: internal, alpha, beta or production"
    echo "2. --user-fraction e.g: 0.1 = 10%; 0.25 = 25%; 1 = 100%"
    echo "1st argument for --track e.g: internal, alpha, beta or production"
    echo "2nd argument for --user-fraction e.g: 0.1 = 10%; 0.25 = 25%; 1 = 100%"
    exit
    fi

    @@ -22,13 +22,14 @@ export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}
    # 02. check for the information (receive user input)
    # git ls/info || git status

    # 03. annotate with git tag
    # 03. checkout & annotate with git tag
    git checkout -b release/v${VERSION_NAME}
    git tag -a $VERSION_NAME -m "release for ${VERSION_NAME}"

    # 04. git add modified gradle file + git push new branch & tag
    git add ${MODULE_NAME}/${BUILD_GRADLE_FILE}
    git commit -m "release for ${VERSION_NAME}" && git push --tags
    git commit -m "release for ${VERSION_NAME}"
    git push -u origin release/v${VERSION_NAME} && git push origin ${VERSION_NAME}

    # 05. auto-publish the AAB
    ./gradlew publishProdReleaseBundle --track=$TRACK --user-fraction=$USER_FRACTION
    # ./gradlew publishProdReleaseBundle --track=$TRACK --user-fraction=$USER_FRACTION
  13. mochadwi revised this gist Dec 21, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@
    - Change `$BUILD_GRADLE_FILE` & `$MODULE_NAME` accordingly to your needs

    ### How to
    - Run this: `./release_script.sh`
    - Run this: `curl -s -L https://git.io/JedBV | bash`
  14. mochadwi revised this gist Dec 20, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion release_script.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ USER_FRACTION=$2

    if [ "$#" -lt 1 ]; then
    echo "Illegal number of parameters - required"
    echo "1. --TRACK e.g: internal, alpha, beta or production"
    echo "1. --track e.g: internal, alpha, beta or production"
    echo "2. --user-fraction e.g: 0.1 = 10%; 0.25 = 25%; 1 = 100%"
    exit
    fi
  15. mochadwi revised this gist Dec 20, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    ### Pre-requisites
    - Add [Triple-T](https://github.com/Triple-T/gradle-play-publisher) dependencies
    - Setup the service account on GCP & link to Play Store (explained in the README.md of Triple-T)
    - Create custom gradle task (to bump version) or see [here](https://gist.github.com/mochadwi/11ffe7bd373520fabb7176a5c48b9953)
    - Use git-flow as branching model

  16. mochadwi revised this gist Dec 20, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ### Pre-requisites
    - Add Triple-T dependencies
    - Add [Triple-T](https://github.com/Triple-T/gradle-play-publisher) dependencies
    - Create custom gradle task (to bump version) or see [here](https://gist.github.com/mochadwi/11ffe7bd373520fabb7176a5c48b9953)
    - Use git-flow as branching model

  17. mochadwi revised this gist Dec 20, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ### Pre-requisites
    - Add Triple-T dependencies
    - Create custom gradle task (to bump version) or see [here](https://gist.github.com/IlyaEremin/8821fbf0069e8e60dfeaeefc19afaca2/)
    - Create custom gradle task (to bump version) or see [here](https://gist.github.com/mochadwi/11ffe7bd373520fabb7176a5c48b9953)
    - Use git-flow as branching model

    ### Notes
  18. mochadwi created this gist Dec 20, 2019.
    10 changes: 10 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    ### Pre-requisites
    - Add Triple-T dependencies
    - Create custom gradle task (to bump version) or see [here](https://gist.github.com/IlyaEremin/8821fbf0069e8e60dfeaeefc19afaca2/)
    - Use git-flow as branching model

    ### Notes
    - Change `$BUILD_GRADLE_FILE` & `$MODULE_NAME` accordingly to your needs

    ### How to
    - Run this: `./release_script.sh`
    34 changes: 34 additions & 0 deletions release_script.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    #!/bin/sh

    # global env
    MODULE_NAME="legacy"
    BUILD_GRADLE_FILE="build.gradle.kts"

    TRACK=$1
    USER_FRACTION=$2

    if [ "$#" -lt 1 ]; then
    echo "Illegal number of parameters - required"
    echo "1. --TRACK e.g: internal, alpha, beta or production"
    echo "2. --user-fraction e.g: 0.1 = 10%; 0.25 = 25%; 1 = 100%"
    exit
    fi

    export VERSION_NAME=`egrep '^[[:blank:]]+versionName[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $2}' | sed s/\"//g`
    export VERSION_CODE=`egrep '^[[:blank:]]+versionCode[[:blank:]]' ${MODULE_NAME}/${BUILD_GRADLE_FILE} | awk '{print $2}'`

    # 01. bumper versionCode & versionName with gradle task

    # 02. check for the information (receive user input)
    # git ls/info || git status

    # 03. annotate with git tag
    git checkout -b release/v${VERSION_NAME}
    git tag -a $VERSION_NAME -m "release for ${VERSION_NAME}"

    # 04. git add modified gradle file + git push new branch & tag
    git add ${MODULE_NAME}/${BUILD_GRADLE_FILE}
    git commit -m "release for ${VERSION_NAME}" && git push --tags

    # 05. auto-publish the AAB
    ./gradlew publishProdReleaseBundle --track=$TRACK --user-fraction=$USER_FRACTION