forked from desktop/desktop
-
Notifications
You must be signed in to change notification settings - Fork 521
74 lines (71 loc) · 2.7 KB
/
create-draft-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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 fetch origin --unshallow
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 }}'
UPSTREAM_BRANCH: 'development'
run: |
git fetch origin linux
git fetch origin $UPSTREAM_BRANCH
git checkout -b $HEAD_BRANCH linux
git push origin $HEAD_BRANCH
git submodule update
echo "One last git config output..."
git config -l --show-origin
echo "Commit identifiers before performing rebase..."
echo "BASE_BRANCH: $(git rev-parse $BASE_BRANCH)"
echo "development: $(git rev-parse origin/$UPSTREAM_BRANCH)"
echo "HEAD_BRANCH: $(git rev-parse $HEAD_BRANCH)"
echo "About to run 'git log --oneline --decorate=full --graph $HEAD_BRANCH...origin/$UPSTREAM_BRANCH'..."
git log --oneline --decorate=full --graph $HEAD_BRANCH...origin/$UPSTREAM_BRANCH
echo "About to run 'git rebase --verbose origin/$UPSTREAM_BRANCH $HEAD_BRANCH --onto $BASE_BRANCH'..."
git rebase --verbose origin/$UPSTREAM_BRANCH $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