-
Notifications
You must be signed in to change notification settings - Fork 48
199 lines (184 loc) · 5.65 KB
/
DownloadDll.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: Download Original Dll files
on:
workflow_call:
inputs:
arch:
description: 'Arch'
required: true
type: string
version:
description: 'Version(e.g. 22H2)'
required: false
type: string
build:
description: 'Build(e.g. 22621)'
required: true
type: string
url:
description: 'Download URL'
required: true
type: string
format:
description: 'File Format'
required: true
type: string
default: .iso
upload:
description: 'Upload'
required: true
type: string
workflow_dispatch:
inputs:
arch:
description: 'Arch'
required: true
type: choice
options:
- x64
- arm64
version:
description: 'Version(e.g. 22H2)'
required: false
type: string
build:
description: 'Build(e.g. 22621)'
required: true
type: string
url:
description: 'Download URL'
required: true
type: string
format:
description: 'File Format'
required: true
type: choice
options:
- .iso
- .wim
- .esd
- .vhdx
- .zip
default: .iso
upload:
description: 'Upload'
required: true
type: choice
options:
- true
- false
default: 'false'
env:
ARCH: ${{ inputs.arch }}
VERSION: ${{ inputs.version }}
BUILD: ${{ inputs.build }}
URL: ${{ inputs.url }}
FORMAT: ${{ inputs.format }}
UPLOAD: ${{ inputs.upload }}
jobs:
download:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo modprobe nbd max_part=8
sudo apt update
sudo apt install -y qemu-kvm wimtools unzip curl
- name: Setup Python
uses: actions/setup-python@v5
with:
check-latest: true
python-version: '3.9'
- name: Download
run: |
echo "Arch: $ARCH"
echo "Version: $VERSION"
echo "Build: $BUILD"
echo "Download URL: $URL"
echo "Format: $FORMAT"
echo "Upload: $UPLOAD"
mkdir original_dll/ 2>/dev/null || :
mkdir original_dll/x64 2>/dev/null || :
mkdir original_dll/arm64 2>/dev/null || :
mkdir original_dll/$ARCH/$BUILD
echo "Arch: $ARCH" >> original_dll/$ARCH/$BUILD/info.txt
echo "Version: $VERSION" >> original_dll/$ARCH/$BUILD/info.txt
echo "Build: $BUILD" >> original_dll/$ARCH/$BUILD/info.txt
echo "Download URL: $URL" >> original_dll/$ARCH/$BUILD/info.txt
echo "Format: $FORMAT" >> original_dll/$ARCH/$BUILD/info.txt
mkdir tmp
cd tmp
curl -o "Windows$FORMAT" "$URL"
ls -lh
- name: VHDX
if: env.FORMAT == '.vhdx'
run: |
cd tmp
sudo qemu-nbd -f vhdx -c /dev/nbd7 Windows.vhdx
sudo fdisk -l /dev/nbd7
mkdir Windows
ls /dev/nbd7*
sudo mount $(python3 ../scripts/DownloadDll_vhdx.py $(ls /dev/nbd7*)) Windows
cp Windows/Windows/System32/icu.dll ../original_dll/$ARCH/$BUILD
cp Windows/Windows/System32/winhttp.dll ../original_dll/$ARCH/$BUILD
sudo umount Windows
- name: ISO
if: env.FORMAT == '.iso'
run: |
cd tmp
mkdir iso
sudo mount -o loop Windows.iso iso
export file_path=$(ls iso/sources/install.*)
mkdir dll
wimextract $file_path 1 /Windows/System32/icu.dll --dest-dir=dll
wimextract $file_path 1 /Windows/System32/winhttp.dll --dest-dir=dll
cp dll/* ../original_dll/$ARCH/$BUILD
sudo umount iso
- name: WIM/ESD
if: env.format == '.wim' || env.format == '.esd'
run: |
cd tmp
mkdir dll
wimextract Windows$FORMAT 1 /Windows/System32/icu.dll --dest-dir=dll
wimextract Windows$FORMAT 1 /Windows/System32/winhttp.dll --dest-dir=dll
cp dll/* ../original_dll/$ARCH/$BUILD
- name: ZIP
if: env.FORMAT == '.zip'
run: |
cd tmp
mkdir zip
mkdir iso
mkdir dll
python3 ../scripts/DownloadDll_zip.py
cp dll/* ../original_dll/$ARCH/$BUILD
- name: Creat Artifact
run: |
cd tmp
mkdir artifact
cp ../original_dll/$ARCH/$BUILD/* artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: original_dll
path: tmp/artifact
- name: Delete tmp
run: |
rm -rf tmp
- name: commit
if: github.event.inputs.upload== 'true'
run: |
git config --global user.email github-actions[bot]@users.noreply.github.com
git config --global user.name github-actions[bot]
git add original_dll/$ARCH/$BUILD
git commit -m "Upload original dlls from $VERSION $ARCH build $BUILD"
git pull
- name: Push changes
if: github.event.inputs.upload== 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
DllInject:
needs: download
if: github.event.inputs.upload== 'true'
uses: ./.github/workflows/DllInject.yml