Skip to content

Commit

Permalink
sketch workflow for drafting release from upstream tag (#1076)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey committed Jun 2, 2024
1 parent 22c73b0 commit 4d7fdc5
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/create-draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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 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 upstream development
git checkout -b development upstream/development
git checkout -b $HEAD_BRANCH linux
git submodule update
echo "Rebasing onto $BASE_BRANCH the difference between development and $HEAD_BRANCH"
echo "BASE_BRANCH: $(git rev-parse $BASE_BRANCH)"
echo "development: $(git rev-parse development)"
echo "HEAD_BRANCH: $(git rev-parse $HEAD_BRANCH)"
git rebase --onto $BASE_BRANCH development $HEAD_BRANCH
git push origin $HEAD_BRANCH
shell: bash

0 comments on commit 4d7fdc5

Please sign in to comment.