Skip to content

Commit

Permalink
fix: derive the branch from version tag
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmannZ committed Apr 30, 2019
1 parent 4fc770d commit 092f95a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
name: Install dependencies (graphql)
command: |
cd packages/graphql
flutter packages get
pub get
- run:
name: Install dependencies (graphql_flutter)
command: |
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
cd packages/graphql
# patch version
~/yq w pubspec.yaml version $CIRCLE_TAG > patched_pubspec.yaml
~/yq w pubspec.yaml version ${CIRCLE_TAG%"@beta"} > patched_pubspec.yaml
rm pubspec.yaml
mv patched_pubspec.yaml pubspec.yaml
- run:
Expand All @@ -155,21 +155,25 @@ jobs:
cd packages/graphql_flutter
# patch version
~/yq w pubspec.yaml version $CIRCLE_TAG > patched_pubspec.yaml
~/yq w pubspec.yaml version ${CIRCLE_TAG%"@beta"} > patched_pubspec.yaml
rm pubspec.yaml
mv patched_pubspec.yaml pubspec.yaml
# patch graphql dependency version
~/yq w pubspec.yaml dependencies.graphql ^$CIRCLE_TAG > patched_pubspec.yaml
~/yq w pubspec.yaml dependencies.graphql ^${CIRCLE_TAG%"@beta"} > patched_pubspec.yaml
rm pubspec.yaml
mv patched_pubspec.yaml pubspec.yaml
- run:
name: Bump version numbers
command: |
if [[ $CIRCLE_TAG =~ ^.*@beta.*$ ]]; then BRANCH=beta; else BRANCH=master; fi
git checkout $BRANCH
git add packages/graphql/pubspec.yaml packages/graphql_flutter/pubspec.yaml
git commit --allow-empty -m "build(Pub): Bump version numbers [skip ci]"
# Push quietly to prevent showing the token in log
git push -q https://${GH_TOKEN}@github.com/zino-app/graphql-flutter.git
git push -q https://${GH_TOKEN}@github.com/zino-app/graphql-flutter.git $BRANCH
- run:
name: Pub deployment (graphql)
command: |
Expand Down

0 comments on commit 092f95a

Please # to comment.