Skip to content

Commit

Permalink
Bitrise yml bump version (#2535)
Browse files Browse the repository at this point in the history
* scriptsworking

* scripts

* scripts

* working

* newscript

* works

* pre-merge-hook

* 1.0.0 (#2560)

* dah

* actions?

* branchasinput

* update

* branch

* Release/testing minor (#2563)

* Bitrise yml bump version (#1)

* added new bitrise yml file

* updated unit test yml

* updated yml

* added code coverage

* added code coverage install

* segment out code setup and validation from test cases

* updating yml audit

* updated yml

* updated yml

* updated yml audits

* updated yml audits

* updated yml audits

* updated yml audits

* updated yml install

* updated yml audit

* updated yml audit

* updated yml segmented code_setup

* updated yml segmented code_setup

* updated yml segmented set to not always run

* updated yml segmented code cov

* updated yml triggers

* updated yml triggers

* updated yml triggers

* updated yml codecov

* switched to ci

* switched to ci

* test deploy

* test deploy ios

* format

* imported env variables

* added env variables

* added env variables

* reconfigured build triggers

* reconfigured build triggers

* reconfigured build triggers

* removed fastlane from build scripts and added commnets to bitrise scripts

* testing android artifact upload

* commented out code that is not needed

* added android deploy paths

* test

* Revert "test"

This reverts commit 77ef282.

* updated android deploy paths

* bitrise-yml-bump-version

* bump_version_minor

* workflow

* PROJECT_LOCATION

* bump_version_minor

* new_version_name

* space

* Revert "space"

This reverts commit e0eb5ad.

* 2.1.1

* new_version_name

* torevert

* Revert "torevert"

This reverts commit a315582.

* d

* revert

* env

* ios

* test android build

* bump_version_minor

* temporarily creating debug android build for testing

* VERSION_NAME

* scriptsworking

* scripts

* scripts

* working

* newscript

* works

* pre-merge-hook

* 1.0.0 (#2560)

* dah

* actions?

* branchasinput

* update

* branch

Co-authored-by: sethkfman <seth.kaufman@consensys.net>

* changename (#2)

* Changetorun (#3)

* changename

* run

* release/test-minor (#4)

* rm-condition (#5)

* Filelocation (#6)

* rm-condition

* file

* Checkout step (#7)

* rm-condition

* file

* checkout-step

* Try (#8)

* a

* Revert "a"

This reverts commit 5df3682.

* Logs (#9)

* a

* Revert "a"

This reverts commit 5df3682.

* logs

* Branch (#10)

* a

* Revert "a"

This reverts commit 5df3682.

* logs

* branch

* Var (#11)

* a

* Revert "a"

This reverts commit 5df3682.

* logs

* branch

* correct

* echo (#12)

* echo

* rm

* pull-request (#13)

* Pull request 2 (#14)

* pull-request

* ref

* GITHUB_REF

* parse

* with-branch (#15)

* Origin branch (#16)

* with-branch

* origin-branch

* base_ref (#17)

* push

* rmrnv

* gh

* action

* event_name

* base_ref

* location

* location

* ls

* find

* file

* file

* GITHUB_TOKEN

* persist

* with

* uses

* bitrise

* sed

* commit

* diff

* release/fake-major

* add-and-commit

* with

* author

* path-to-th-repo

* checkout@v1

* v2

* Bump version name

* useref (#18)

* change

* ref

* something (#19)

* Branch 3 (#20)

* something

* onmerge

* fix

* Branch 4 (#21)

* something

* onmerge

* fix

* GITHUB_REF

* GITHUB_CONTEXT

* GITHUB_CONTEXT

* BASE_REF

* HEAD_REF

* nobump

* something (#22)

* s (#23)

* s

* Bump version name

* types (#24)

* create-pr

* something (#25)

* Release/ww patch (#26)

* something

* opened

* Bump version name

* othercommit

* Release/nohead patch (#36)

* ghactions

* something

* fix

* nopush

* head

* pull

* nohead

* nopull

* nohead

* update

* gitpush

* force

* Bump version name

* opened

Co-authored-by: github-actions <github-actions@github.com>

* rmonpush

* Bump version name

* startsWith

* main

* rmstartwith

* line

Co-authored-by: sethkfman <seth.kaufman@consensys.net>
Co-authored-by: github-actions <github-actions@github.com>

* newscript

* release/testbump-patch (#2570)

* space

* branch

* notopenend

* diff

* Bump version name

Co-authored-by: github-actions <github-actions@github.com>

* addbranch

* version

* ifrelease

* add

* lasttest

* ifcontains

* branch

Co-authored-by: sethkfman <seth.kaufman@consensys.net>
Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
3 people committed Apr 22, 2021
1 parent 644fb58 commit f7734a8
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/bump-version-name.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Bump version name
on:
# push:
# branches:
# - develop
pull_request:
branches:
- develop
- main
- bitrise_yml_new
types: [opened]
jobs:
bump-version-name:
runs-on: ubuntu-latest
if: contains(github.head_ref, "release/")
steps:
- uses: actions/checkout@v2
- name: Bump script
env:
HEAD_REF: ${{ github.head_ref }}
run: |
./scripts/bump-version.sh "$HEAD_REF"
git diff
git config user.name github-actions
git config user.email github-actions@github.com
git add bitrise.yml
git add package.json
git commit -m "Bump version name"
git push origin HEAD:"$HEAD_REF" --force
2 changes: 1 addition & 1 deletion bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ app:
PROJECT_LOCATION_IOS: ios
- opts:
is_expand: false
VERSION_NAME: "'2.1.1'"
VERSION_NAME: 2.2.0
- opts:
is_expand: false
ANDROID_APK_LINK: ''
Expand Down
36 changes: 36 additions & 0 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

set -e
set -u
set -o pipefail

versionName="$(awk '/VERSION_NAME: /{print $2}' bitrise.yml)"

MAJOR=$(awk -F. '{print $1}' <<< $versionName)
MINOR=$(awk -F. '{print $2}' <<< $versionName)
PATCH=$(awk -F. '{print $3}' <<< $versionName)
version=$MAJOR'.'$MINOR'.'$PATCH

if [[ $1 == *"release/"* ]] ; then
if [[ $1 == *"-major"* ]] ; then
major=$(($MAJOR + 1));
minor="0";
patch="0";
version=$major'.'$minor'.'$patch
elif [[ $1 == *"-minor"* ]] ; then
minor=$(($MINOR + 1));
patch="0";
version=$MAJOR'.'$minor'.'$patch
elif [[ $1 == *"-patch"* ]] ; then
patch=$(($PATCH + 1));
version=$MAJOR'.'$MINOR'.'$patch
fi

echo "Bumping versionName to"
echo $version

sed -i -e 's/VERSION_NAME: [0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}/VERSION_NAME: '$version'/' bitrise.yml
sed -i -e 's/"version": "[0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}"/"version": "'$version'"/' package.json

echo "Bumping versionName finished"
fi

0 comments on commit f7734a8

Please sign in to comment.