forked from desktop/desktop
-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sketch workflow for drafting release from upstream tag (#1076)
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: 'Create draft release from upstream' | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release: | ||
description: 'Upstream release' | ||
required: true | ||
type: string | ||
publish: | ||
description: 'Whether to publish the release to GitHub on success' | ||
type: boolean | ||
required: false | ||
default: false | ||
|
||
jobs: | ||
publish-draft-release: | ||
runs-on: ubuntu-latest | ||
name: Publish draft release | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.CREATE_RELEASE_AUTOMATION_TOKEN }} | ||
- name: Configure git | ||
run: | | ||
git config --global user.name "shiftbot" | ||
git config --global user.email "[email protected]" | ||
git config --local core.autocrlf "input" | ||
git remote add upstream https://github.com/desktop/desktop.git | ||
shell: bash | ||
- name: Create baseline branch on fork | ||
id: create-baseline-branch | ||
env: | ||
RELEASE_TAG: ${{ inputs.release }} | ||
BASE_BRANCH: 'linux-${{ inputs.release }}' | ||
run: | | ||
git fetch upstream 'refs/tags/*:refs/tags/*' | ||
git checkout -b $BASE_BRANCH $RELEASE_TAG | ||
git push origin $BASE_BRANCH | ||
git config -l --show-origin | ||
shell: bash | ||
- name: Rebase Linux customizations on top of upstream release branch | ||
id: rebase-linux-branch | ||
env: | ||
HEAD_BRANCH: 'apply-changes-${{ inputs.release }}' | ||
BASE_BRANCH: 'linux-${{ inputs.release }}' | ||
run: | | ||
git fetch origin linux | ||
git fetch origin development | ||
git checkout -b development origin/development | ||
git checkout -b $HEAD_BRANCH linux | ||
git push origin $HEAD_BRANCH | ||
git submodule update | ||
echo "Commit identifiers before performing rebase..." | ||
echo "BASE_BRANCH: $(git rev-parse $BASE_BRANCH)" | ||
echo "development: $(git rev-parse development)" | ||
echo "HEAD_BRANCH: $(git rev-parse $HEAD_BRANCH)" | ||
echo "About to run 'git log --oneline --graph $HEAD_BRANCH...development'..." | ||
git log --oneline --graph $HEAD_BRANCH...development | ||
echo "About to run 'git rebase --onto $BASE_BRANCH development $HEAD_BRANCH'..." | ||
git rebase --verbose development $HEAD_BRANCH --onto $BASE_BRANCH | ||
git push origin $HEAD_BRANCH | ||
shell: bash | ||
continue-on-error: true | ||
- name: Review current status | ||
id: status | ||
run: | | ||
git status | ||
shell: bash |