Skip to content

Commit

Permalink
Update version bump workflow (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrassia authored Dec 18, 2023
1 parent 4c079e8 commit a5328e5
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ name: Version Bump
run-name: Version Bump - v${{ inputs.version_number }}

on:
workflow_call:
inputs:
project:
description: "Project"
required: true
type: string
version_number:
description: "New version (example: '2024.1.0')"
required: true
type: string
workflow_dispatch:
inputs:
project:
Expand All @@ -29,6 +19,10 @@ on:
version_number:
description: "New version (example: '2024.1.0')"
required: true
cut_rc_branch:
description: "Cut RC branch?"
default: true
type: boolean

jobs:
bump_version:
Expand Down Expand Up @@ -63,9 +57,8 @@ jobs:
- name: Checkout Branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: bitwarden/sdk
ref: main
token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
repository: bitwarden/sdk

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@82a020f1f7f605c65dd2449b392a52c3fcfef7ef # v6.0.0
Expand Down Expand Up @@ -206,3 +199,28 @@ jobs:
GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }}
run: gh pr merge $PR_NUMBER --squash --auto --delete-branch

cut_rc:
name: Cut RC branch
needs: bump_version
if: ${{ inputs.cut_rc_branch == true }}
runs-on: ubuntu-22.04
steps:
- name: Checkout Branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: main

- name: Check if RC branch exists
run: |
remote_rc_branch_check=$(git ls-remote --heads origin rc | wc -l)
if [[ "${remote_rc_branch_check}" -gt 0 ]]; then
echo "Remote RC branch exists."
echo "Please delete current RC branch before running again."
exit 1
fi
- name: Cut RC branch
run: |
git switch --quiet --create rc
git push --quiet --set-upstream origin rc

0 comments on commit a5328e5

Please sign in to comment.