-
Notifications
You must be signed in to change notification settings - Fork 99
167 lines (164 loc) · 6.93 KB
/
branch_sync.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: branch sync
on:
workflow_dispatch:
schedule:
- cron: '30 2 * * *'
jobs:
prepare:
if: vars.ENABLE_BRANCH_SYNC == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ng
path: mcpelauncher-ng
submodules: true
- uses: actions/checkout@v3
with:
ref: qt6
path: mcpelauncher-qt6
submodules: true
- name: Update branches
run: |
set -x
dirs=( "mcpelauncher-ng" "mcpelauncher-qt6" )
common_submodules=( "logger" "base64" "file-util" "properties-parser" "simple-ipc" "daemon-utils" "msa-daemon-client" "eglut" "linux-gamepad" "game-window" "file-picker" "cll-telemetry" "minecraft-imported-symbols" "mcpelauncher-common" "mcpelauncher-core" "mcpelauncher-client" "arg-parser" "mcpelauncher-linux-bin" "epoll-shim" "osx-elf-header" "mcpelauncher-mac-bin" "android-support-headers" "libc-shim" "mcpelauncher-linker" "libjnivm" "sdl3" "imgui" )
# ui_submodules=("mcpelauncher-webview" "mcpelauncher-errorwindow")
for dir in "${dirs[@]}"
do
pushd "$dir"
# from https://github.com/orgs/community/discussions/26560
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
for submodule in "${common_submodules[@]}"
do
git -C "$submodule" fetch origin HEAD
git -C "$submodule" reset --hard FETCH_HEAD
done
git add . && git commit -m "Branch Sync" || (echo "Nothing to do" && exit 0)
git push origin "HEAD:refs/heads/branch-sync-$dir" -f
echo "$dir=$(git rev-parse HEAD)" >> $GITHUB_ENV
popd
done
shell: bash
outputs:
mcpelauncher-ng: ${{ env.mcpelauncher-ng }}
mcpelauncher-qt6: ${{ env.mcpelauncher-qt6 }}
sync: ${{ env.mcpelauncher-ng && env.mcpelauncher-qt6 && 'true' || 'false' }}
linux-AppImage:
if: needs.prepare.outputs.sync == 'true'
needs: prepare
uses: minecraft-linux/appimage-builder/.github/workflows/main.yml@main
with:
mcpelauncher-ref: ${{ needs.prepare.outputs.mcpelauncher-ng }}
mcpelauncher-qt6-ref: ${{ needs.prepare.outputs.mcpelauncher-qt6 }}
update-information: https://github.com/minecraft-linux/mcpelauncher-manifest/releases/download/nightly
# We use a single tag in this distribution matching the location of the zsync file
tag-name: "-"
linux-AppImage-sdl3:
if: needs.prepare.outputs.sync == 'true'
needs: prepare
uses: minecraft-linux/appimage-builder/.github/workflows/main.yml@main
with:
mcpelauncher-ref: ${{ needs.prepare.outputs.mcpelauncher-ng }}
mcpelauncher-qt6-ref: ${{ needs.prepare.outputs.mcpelauncher-qt6 }}
update-information: https://github.com/minecraft-linux/mcpelauncher-manifest/releases/download/nightly
# We use a single tag in this distribution matching the location of the zsync file
tag-name: "-"
suffix: "-sdl3"
appImageFlags: |-
-l -DGAMEWINDOW_SYSTEM=SDL3 -l -DSDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS=1
macOS:
if: needs.prepare.outputs.sync == 'true'
needs: prepare
uses: minecraft-linux/macos-builder/.github/workflows/main.yml@main
with:
mcpelauncher-ref: ${{ needs.prepare.outputs.mcpelauncher-ng }}
secrets: inherit
linux-pkg:
if: needs.prepare.outputs.sync == 'true'
needs: prepare
uses: minecraft-linux/pkg/.github/workflows/build-linux.yml@main
with:
shas: |-
{
"mcpelauncher-manifest": {
"": ${{ tojson(needs.prepare.outputs.mcpelauncher-ng) }},
"qt6": ${{ tojson(needs.prepare.outputs.mcpelauncher-qt6) }}
}
}
deploy:
if: needs.prepare.outputs.sync == 'true' && !failure() && !cancelled()
needs:
- prepare
- linux-AppImage
- linux-AppImage-sdl3
- macOS
- linux-pkg
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ng
path: mcpelauncher-ng
- uses: actions/checkout@v3
with:
ref: qt6
path: mcpelauncher-qt6
- name: Update branches
run: |
# from https://github.com/orgs/community/discussions/26560
git -C mcpelauncher-ng config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git -C mcpelauncher-ng config user.name "github-actions[bot]"
git -C mcpelauncher-qt6 config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git -C mcpelauncher-qt6 config user.name "github-actions[bot]"
git -C mcpelauncher-ng fetch origin ${{ needs.prepare.outputs.mcpelauncher-ng }}
git -C mcpelauncher-ng push origin ${{ needs.prepare.outputs.mcpelauncher-ng }}:ng
git -C mcpelauncher-ng push origin ${{ needs.prepare.outputs.mcpelauncher-ng }}:refs/tags/nightly -f
git -C mcpelauncher-qt6 fetch origin ${{ needs.prepare.outputs.mcpelauncher-qt6 }}
git -C mcpelauncher-qt6 push origin ${{ needs.prepare.outputs.mcpelauncher-qt6 }}:qt6
shell: bash
publish:
needs: deploy
if: needs.prepare.outputs.sync == 'true' && !failure() && !cancelled()
permissions: write-all
runs-on: ubuntu-latest
env:
LAUNCHER_RELEASE_DESCRIPTION: |
This release appends assets every day, the one with the highest number is the latest one.
Please use releases from https://mcpelauncher.readthedocs.io/.
Builds from this tag are very very unstable, but new changes lands here earlier.
**The macOS binaries provided here don't support the builtin updater, you risk falling behind updates while using a nightly**
steps:
- uses: actions/checkout@v3
- name: Setup Vars
id: setup-vars
uses: actions/github-script@v6
with:
script: |
core.setOutput("owner", context.repo.owner)
core.setOutput("repo", context.repo.repo)
- name: Download Everything
uses: actions/download-artifact@v4
with:
path: output
pattern: +(appimage|dmg)-*
merge-multiple: true
- name: Download ghr
run: |
curl -L https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz --output ghr.tar.gz
tar -xf ghr.tar.gz
- name: Upload Nightly
run: |
./ghr*/ghr -t ${{ secrets.GITHUB_TOKEN }} -u ${{ steps.setup-vars.outputs.owner }} -r ${{ steps.setup-vars.outputs.repo }} -b "$LAUNCHER_RELEASE_DESCRIPTION" -replace "nightly" output/
- name: Update Quick Links
run: |
for file in *; do
LAUNCHER_RELEASE_DESCRIPTION="$LAUNCHER_RELEASE_DESCRIPTION- [$file](${{ github.server_url }}/${{ steps.setup-vars.outputs.owner }}/${{ steps.setup-vars.outputs.repo }}/releases/download/nightly/$file)
"
done
gh release edit nightly --notes "$LAUNCHER_RELEASE_DESCRIPTION"
working-directory: output
env:
GH_TOKEN: ${{ github.token }}
continue-on-error: true