From 1f4d22b29b710d144251134b3bb2c31c725e294b Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Sun, 2 Jun 2024 16:05:26 -0300 Subject: [PATCH] sketch workflow for drafting release from upstream tag (#1076) --- .github/workflows/create-draft-release.yml | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/create-draft-release.yml diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml new file mode 100644 index 00000000000..a27d8969a99 --- /dev/null +++ b/.github/workflows/create-draft-release.yml @@ -0,0 +1,54 @@ +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 "github@brendanforster.com" + 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 + git checkout -b $BASE_BRANCH $RELEASE_TAG + git push origin $BASE_BRANCH + 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 development -b upstream/development + git checkout -b $HEAD_BRANCH linux + git submodule update + git rebase --onto $BASE_BRANCH development $HEAD_BRANCH + git push origin $HEAD_BRANCH + shell: bash