|
| 1 | +name: 'Create draft release from upstream' |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + release: |
| 7 | + description: 'Upstream release' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + publish: |
| 11 | + description: 'Whether to publish the release to GitHub on success' |
| 12 | + type: boolean |
| 13 | + required: false |
| 14 | + default: false |
| 15 | + |
| 16 | +jobs: |
| 17 | + publish-draft-release: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + name: Publish draft release |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + token: ${{ secrets.CREATE_RELEASE_AUTOMATION_TOKEN }} |
| 25 | + - name: Configure git |
| 26 | + run: | |
| 27 | + git config --global user.name "shiftbot" |
| 28 | + git config --global user.email "[email protected]" |
| 29 | + git config --local core.autocrlf "input" |
| 30 | + git remote add upstream https://github.com/desktop/desktop.git |
| 31 | + shell: bash |
| 32 | + - name: Create baseline branch on fork |
| 33 | + id: create-baseline-branch |
| 34 | + env: |
| 35 | + RELEASE_TAG: ${{ inputs.release }} |
| 36 | + BASE_BRANCH: 'linux-${{ inputs.release }}' |
| 37 | + run: | |
| 38 | + git fetch upstream 'refs/tags/*:refs/tags/*' |
| 39 | + git checkout -b $BASE_BRANCH $RELEASE_TAG |
| 40 | + git push origin $BASE_BRANCH |
| 41 | + git config -l --show-origin |
| 42 | + shell: bash |
| 43 | + - name: Rebase Linux customizations on top of upstream release branch |
| 44 | + id: rebase-linux-branch |
| 45 | + env: |
| 46 | + HEAD_BRANCH: 'apply-changes-${{ inputs.release }}' |
| 47 | + BASE_BRANCH: 'linux-${{ inputs.release }}' |
| 48 | + run: | |
| 49 | + git fetch origin linux |
| 50 | + git fetch origin development |
| 51 | + git checkout -b development origin/development |
| 52 | + git checkout -b $HEAD_BRANCH linux |
| 53 | + git push origin $HEAD_BRANCH |
| 54 | + git submodule update |
| 55 | + echo "About to run 'git rebase --onto $BASE_BRANCH development $HEAD_BRANCH'..." |
| 56 | + echo "BASE_BRANCH: $(git rev-parse $BASE_BRANCH)" |
| 57 | + echo "development: $(git rev-parse development)" |
| 58 | + echo "HEAD_BRANCH: $(git rev-parse $HEAD_BRANCH)" |
| 59 | + git log --oneline --graph $HEAD_BRANCH...development |
| 60 | + git rebase --verbose development $HEAD_BRANCH --onto $BASE_BRANCH |
| 61 | + git push origin $HEAD_BRANCH |
| 62 | + shell: bash |
| 63 | + continue-on-error: true |
| 64 | + - name: Review current status |
| 65 | + id: status |
| 66 | + run: | |
| 67 | + git status |
| 68 | + shell: bash |
0 commit comments