mirror of
https://github.com/bitwarden/server.git
synced 2025-04-07 14:08:13 -05:00
Changed release workflow to create PR instead of pick
This commit is contained in:
parent
39ac93326d
commit
d567c68525
@ -1,4 +1,4 @@
|
|||||||
name: Repository management
|
name: Release version management
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -187,9 +187,8 @@ jobs:
|
|||||||
- name: Push changes
|
- name: Push changes
|
||||||
run: git push
|
run: git push
|
||||||
|
|
||||||
|
create_pr:
|
||||||
cherry_pick:
|
name: Create PR to release candidate branches
|
||||||
name: Cherry-Pick Commit(s)
|
|
||||||
if: ${{ needs.setup.outputs.branch != 'none' }}
|
if: ${{ needs.setup.outputs.branch != 'none' }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
needs:
|
needs:
|
||||||
@ -224,8 +223,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CUT_BRANCH: ${{ needs.setup.outputs.branch }}
|
CUT_BRANCH: ${{ needs.setup.outputs.branch }}
|
||||||
run: |
|
run: |
|
||||||
# Function for cherry-picking
|
create_pull_request () {
|
||||||
cherry_pick () {
|
|
||||||
local source_branch=$1
|
local source_branch=$1
|
||||||
local destination_branch=$2
|
local destination_branch=$2
|
||||||
|
|
||||||
@ -239,8 +237,12 @@ jobs:
|
|||||||
DESTINATION_VERSION=$(xmllint -xpath "/Project/PropertyGroup/Version/text()" Directory.Build.props)
|
DESTINATION_VERSION=$(xmllint -xpath "/Project/PropertyGroup/Version/text()" Directory.Build.props)
|
||||||
|
|
||||||
if [[ "$DESTINATION_VERSION" != "$SOURCE_VERSION" ]]; then
|
if [[ "$DESTINATION_VERSION" != "$SOURCE_VERSION" ]]; then
|
||||||
|
git checkout -b "increment-version-to-$DESTINATION_VERSION-on-$destination_branch"
|
||||||
git cherry-pick --strategy-option=theirs -x $SOURCE_COMMIT
|
git cherry-pick --strategy-option=theirs -x $SOURCE_COMMIT
|
||||||
git push -u origin $destination_branch
|
gh pr create \
|
||||||
|
--base $destination_branch \
|
||||||
|
--title "Increment version to $DESTINATION_VERSION on $destination_branch" \
|
||||||
|
--body "This PR was created automatically by GitHub Actions to increment the version to $DESTINATION_VERSION on $destination_branch." \
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,17 +252,17 @@ jobs:
|
|||||||
# If the 'rc' branch exists:
|
# If the 'rc' branch exists:
|
||||||
if [[ $(git ls-remote --heads origin rc) ]]; then
|
if [[ $(git ls-remote --heads origin rc) ]]; then
|
||||||
|
|
||||||
# Chery-pick from 'rc' into 'hotfix-rc'
|
# Create PR from 'rc' into 'hotfix-rc' to make hotfix-rc consume the old version
|
||||||
cherry_pick rc hotfix-rc
|
create_pull_request rc hotfix-rc
|
||||||
|
|
||||||
# Cherry-pick from 'main' into 'rc'
|
# Create PR from 'main' into 'rc' to allocate the new version to `rc`
|
||||||
cherry_pick main rc
|
create_pull_request main rc
|
||||||
|
|
||||||
# If the 'rc' branch does not exist:
|
# If the 'rc' branch does not exist:
|
||||||
else
|
else
|
||||||
|
|
||||||
# Cherry-pick from 'main' into 'hotfix-rc'
|
# Create PR from 'main' into 'rc' to allocate the new version to `rc`
|
||||||
cherry_pick main hotfix-rc
|
create_pull_request main hotfix-rc
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -268,13 +270,13 @@ jobs:
|
|||||||
elif [[ "$CUT_BRANCH" == "rc" ]]; then
|
elif [[ "$CUT_BRANCH" == "rc" ]]; then
|
||||||
|
|
||||||
# Cherry-pick from 'main' into 'rc'
|
# Cherry-pick from 'main' into 'rc'
|
||||||
cherry_pick main rc
|
create_pull_request main rc
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
move_future_db_scripts:
|
move_future_db_scripts:
|
||||||
name: Move finalization database scripts
|
name: Move finalization database scripts
|
||||||
needs: cherry_pick
|
needs: create_pr
|
||||||
uses: ./.github/workflows/_move_finalization_db_scripts.yml
|
uses: ./.github/workflows/_move_finalization_db_scripts.yml
|
||||||
secrets: inherit
|
secrets: inherit
|
Loading…
x
Reference in New Issue
Block a user