Skip to content

Commit

Permalink
Merge pull request #35 from jharveysmith/branch_awareness
Browse files Browse the repository at this point in the history
Branch awareness
  • Loading branch information
jharveysmith authored Oct 19, 2020
2 parents c1d2464 + e10a81b commit c84ee6c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/update-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
fetch-depth: 1
- name: "Configure git"
run: |
git config user.name 'YugaByte CI'
Expand All @@ -30,6 +31,24 @@ jobs:
fi
echo "Extracted the version number '${version_number}'."
echo "::set-output name=yb_version::${version_number}"
- name: "Switch to correct branch"
id: switch-branch
run: |
# We use the yb_release_train as the branch in this repo
# This allows us to map multiple '2.2' release branches to a single set of helm charts
branch_name="${{github.events.client_payload.yb_release_train}}"
if git branch | grep -qE "^${branch_name}$"; then
# branch already exists so check it out
git checkout ${branch_name}
else
# First time creating charts for this release
# This won't start working 'correctly' till 2.4
# till then, we will need to manually create the new branches and seed them with
# sufficiently old version numbers (the update script won't go down versions)
git checkout -b ${branch_name} origin/master
fi
echo "Extracted the branch: '${branch_name}'"
echo "::set-output name=yb_branch::${branch_name}"
- name: "Check python version and install dependencies"
run: |
python3 --version
Expand All @@ -47,7 +66,7 @@ jobs:
git add ./stable/yugabyte/Chart.yaml ./stable/yugaware/Chart.yaml \
./stable/yugabyte/values.yaml ./stable/yugaware/values.yaml ./stable/yugabyte/app-readme.md
git commit -m "Update the version to ${{steps.extract-version.outputs.yb_version}}"
git push origin ${{ github.ref }}
git push
- name: "Show git status in case of failure"
if: steps.update-version.outcome == 'failure'
run: |
Expand Down

0 comments on commit c84ee6c

Please sign in to comment.