-
Notifications
You must be signed in to change notification settings - Fork 0
428 lines (372 loc) · 18.8 KB
/
release.yml
File metadata and controls
428 lines (372 loc) · 18.8 KB
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30 # 增加超时时间至30分钟
strategy:
max-parallel: 6 # 一次最多并行运行 2 个构建任务
matrix:
include:
- os: ubuntu-22.04
platform: 'linux-x86_64'
rust_target: 'x86_64-unknown-linux-gnu'
- os: macos-latest
platform: 'darwin-x86_64'
rust_target: 'x86_64-apple-darwin'
- os: macos-14
platform: 'darwin-aarch64'
rust_target: 'aarch64-apple-darwin'
- os: windows-latest
platform: 'windows-x86_64'
rust_target: 'x86_64-pc-windows-msvc'
- os: ubuntu-latest
platform: 'android'
rust_target: 'aarch64-linux-android'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'yarn'
- name: Set up Java for Android build
if: matrix.platform == 'android'
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Set up Android SDK
if: matrix.platform == 'android'
uses: android-actions/setup-android@v3
- name: Install NDK and set NDK_HOME
if: matrix.platform == 'android'
run: |
echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager "ndk;25.1.8937393"
echo "NDK_HOME=${ANDROID_HOME}/ndk/25.1.8937393" >> $GITHUB_ENV
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.rust_target }}
components: rust-src # for android
- name: Install additional Rust targets for Android
if: matrix.platform == 'android'
run: |
rustup target add armv7-linux-androideabi
rustup target add x86_64-linux-android
- name: Install Rust dependencies for Linux
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
pkg-config \
libglib2.0-dev \
libcairo2-dev \
libatk1.0-dev \
libgdk-pixbuf2.0-dev \
libpango1.0-dev \
libsoup-3.0-dev \
libssl-dev \
openssl
- name: Setup OpenSSL for Linux
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-22.04'
run: |
echo "OPENSSL_DIR=/usr" >> $GITHUB_ENV
echo "OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=/usr/include/openssl" >> $GITHUB_ENV
- name: Install OpenSSL for macOS
if: runner.os == 'macOS'
run: |
# 根据目标架构安装正确的 OpenSSL
if [[ "${{ matrix.rust_target }}" == "x86_64-apple-darwin" ]]; then
# 对于 x86_64 构建,确保使用正确的 Homebrew 路径
# 首先卸载可能存在的 arm64 版本
brew uninstall --ignore-dependencies openssl@3 || true
# 检查并安装 x86_64 版本的 Homebrew 到 /usr/local
if [ ! -f "/usr/local/bin/brew" ]; then
# 安装 x86_64 版本的 Homebrew 到 /usr/local
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# 使用 /usr/local/bin/brew 安装 OpenSSL
arch -x86_64 /usr/local/bin/brew install openssl@3
# 确保 PATH 包含 /usr/local/bin
echo "/usr/local/bin" >> $GITHUB_PATH
# 设置环境变量指向 x86_64 版本
OPENSSL_PREFIX=$(arch -x86_64 /usr/local/bin/brew --prefix openssl@3)
echo "OPENSSL_DIR=$OPENSSL_PREFIX" >> $GITHUB_ENV
echo "OPENSSL_LIB_DIR=$OPENSSL_PREFIX/lib" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=$OPENSSL_PREFIX/include" >> $GITHUB_ENV
echo "OPENSSL_STATIC=1" >> $GITHUB_ENV
echo "OPENSSL_NO_VENDOR=1" >> $GITHUB_ENV
# 设置编译器标志
echo "CFLAGS=-arch x86_64 -I$OPENSSL_PREFIX/include" >> $GITHUB_ENV
echo "LDFLAGS=-arch x86_64 -L$OPENSSL_PREFIX/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I$OPENSSL_PREFIX/include" >> $GITHUB_ENV
# 设置 PKG_CONFIG_PATH
echo "PKG_CONFIG_PATH=$OPENSSL_PREFIX/lib/pkgconfig" >> $GITHUB_ENV
# 强制 Rust 使用正确的链接器标志
echo "RUSTFLAGS=-C target-cpu=x86-64 -C link-arg=-arch -C link-arg=x86_64 -L $OPENSSL_PREFIX/lib" >> $GITHUB_ENV
else
# 对于 aarch64 构建
brew install openssl@3
echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> $GITHUB_ENV
echo "OPENSSL_LIB_DIR=$(brew --prefix openssl@3)/lib" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=$(brew --prefix openssl@3)/include" >> $GITHUB_ENV
echo "OPENSSL_STATIC=1" >> $GITHUB_ENV
fi
- name: Install OpenSSL for Windows
if: runner.os == 'Windows'
run: |
# 使用 vcpkg 安装 OpenSSL,这是 Rust 生态系统推荐的方式
vcpkg install openssl:x64-windows-static
echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV
echo "OPENSSL_DIR=C:\vcpkg\installed\x64-windows-static" >> $env:GITHUB_ENV
echo "OPENSSL_LIB_DIR=C:\vcpkg\installed\x64-windows-static\lib" >> $env:GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=C:\vcpkg\installed\x64-windows-static\include" >> $env:GITHUB_ENV
echo "OPENSSL_STATIC=1" >> $env:GITHUB_ENV
- name: Install dependencies
run: yarn install
- name: Setup Android signing
if: matrix.platform == 'android'
run: |
KEYSTORE_PATH=$RUNNER_TEMP/keystore.jks
echo "storeFile=$KEYSTORE_PATH" > src-tauri/keystore.properties
echo "storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" >> src-tauri/keystore.properties
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> src-tauri/keystore.properties
echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> src-tauri/keystore.properties
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > $KEYSTORE_PATH
- name: Import Apple Certificate
if: runner.os == 'macOS'
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
- name: Clean Rust cache for macOS x86_64
if: matrix.rust_target == 'x86_64-apple-darwin'
run: |
# 清理可能存在的错误架构缓存
cd src-tauri
cargo clean
cd ..
rm -rf ~/.cargo/registry/cache
rm -rf ~/.cargo/git/db
rm -rf src-tauri/target
- name: Build the application
if: matrix.platform != 'android'
shell: bash
run: |
# 对于 macOS x86_64,强制重新编译 openssl-sys
if [[ "${{ matrix.rust_target }}" == "x86_64-apple-darwin" ]]; then
echo "Checking if openssl-sys exists in Cargo.lock before update..."
if [ -f "src-tauri/Cargo.lock" ] && grep -q 'name = "openssl-sys"' src-tauri/Cargo.lock; then
echo "openssl-sys found. Forcing cargo to update this crate."
(cd src-tauri && cargo update -p openssl-sys) || true
else
echo "openssl-sys not found in lockfile. Skip forced update."
fi
fi
yarn tauri build --target ${{ matrix.rust_target }}
# 确保为 macOS 平台生成 DMG 签名文件
if [[ "${{ matrix.platform }}" == "darwin-"* ]]; then
echo "Checking for DMG files and generating signatures if missing..."
find src-tauri/target/${{ matrix.rust_target }}/release/bundle/dmg -name "*.dmg" -exec sh -c 'if [ ! -f "$1.sig" ]; then echo "Generating signature for $1"; tauri signer sign "$1" --private-key "$TAURI_SIGNING_PRIVATE_KEY" --password "$TAURI_SIGNING_PRIVATE_KEY_PASSWORD"; fi' _ {} \;
fi
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
OPENSSL_DIR: ${{ env.OPENSSL_DIR }}
OPENSSL_LIB_DIR: ${{ env.OPENSSL_LIB_DIR }}
OPENSSL_INCLUDE_DIR: ${{ env.OPENSSL_INCLUDE_DIR }}
OPENSSL_STATIC: ${{ env.OPENSSL_STATIC }}
OPENSSL_NO_VENDOR: ${{ env.OPENSSL_NO_VENDOR }}
VCPKG_ROOT: ${{ env.VCPKG_ROOT }}
CFLAGS: ${{ env.CFLAGS }}
LDFLAGS: ${{ env.LDFLAGS }}
CPPFLAGS: ${{ env.CPPFLAGS }}
PKG_CONFIG_PATH: ${{ env.PKG_CONFIG_PATH }}
RUSTFLAGS: ${{ env.RUSTFLAGS }}
- name: Build Android App Bundle (AAB)
if: matrix.platform == 'android'
run: |
rm -rf src-tauri/gen
yarn tauri android init
yarn tauri android build --target aarch64 --target armv7
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
OPENSSL_DIR: ${{ env.OPENSSL_DIR }}
OPENSSL_LIB_DIR: ${{ env.OPENSSL_LIB_DIR }}
OPENSSL_INCLUDE_DIR: ${{ env.OPENSSL_INCLUDE_DIR }}
VCPKG_ROOT: ${{ env.VCPKG_ROOT }}
OPENSSL_STATIC: ${{ env.OPENSSL_STATIC }}
- name: Upload Desktop artifact
if: matrix.platform != 'android'
uses: actions/upload-artifact@v4
with:
name: tauri-build-${{ matrix.platform }}
path: |
src-tauri/target/${{ matrix.rust_target }}/release/bundle/
- name: Upload Android artifact
if: matrix.platform == 'android'
uses: actions/upload-artifact@v4
with:
name: tauri-build-${{ matrix.platform }}
path: |
src-tauri/gen/android/app/build/outputs/bundle/universalRelease/release/
src-tauri/gen/android/app/build/outputs/apk/universal/release/
src-tauri/gen/android/app/build/outputs/**/*.sig
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write # 允许上传 Release 产物
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: yarn install
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: src-tauri/target/
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Generate update manifest
id: generate_manifest
run: |
# 赋予执行权限
chmod +x scripts/generate-update-manifest.cjs
# 运行脚本
node scripts/generate-update-manifest.cjs
env:
GITHUB_REPOSITORY: ${{ github.repository }}
RELEASE_NOTES: "See the release notes for details."
npm_package_version: ${{ steps.get_version.outputs.VERSION }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: 'Release ${{ github.ref_name }}'
body: |
Automated release for version ${{ github.ref_name }}.
draft: false
prerelease: false
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x # 开启调试模式
# 定义根目录
TARGET_DIR="src-tauri/target"
VERSION="${{ steps.get_version.outputs.VERSION }}"
# 创建一个临时目录来整理所有待上传的文件
UPLOAD_DIR=$(mktemp -d)
echo "UPLOAD_DIR=$UPLOAD_DIR" >> $GITHUB_ENV
# 查找并移动 Linux x86_64 产物
if [ -d "$TARGET_DIR/tauri-build-linux-x86_64" ]; then
find "$TARGET_DIR/tauri-build-linux-x86_64/appimage" -name "*.AppImage" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-amd64.AppImage" \;
find "$TARGET_DIR/tauri-build-linux-x86_64/appimage" -name "*.AppImage.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-amd64.AppImage.sig" \;
find "$TARGET_DIR/tauri-build-linux-x86_64/deb" -name "*.deb" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-amd64.deb" \;
find "$TARGET_DIR/tauri-build-linux-x86_64/deb" -name "*.deb.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-amd64.deb.sig" \;
find "$TARGET_DIR/tauri-build-linux-x86_64/rpm" -name "*.rpm" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-amd64.rpm" \;
find "$TARGET_DIR/tauri-build-linux-x86_64/rpm" -name "*.rpm.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-amd64.rpm.sig" \;
fi
# 查找并移动 macOS x64 产物
if [ -d "$TARGET_DIR/tauri-build-darwin-x86_64" ]; then
# 处理 .app.tar.gz 文件
find "$TARGET_DIR/tauri-build-darwin-x86_64/macos" -name "*.app.tar.gz" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-x86_64.app.tar.gz" \;
find "$TARGET_DIR/tauri-build-darwin-x86_64/macos" -name "*.app.tar.gz.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-x86_64.app.tar.gz.sig" \;
# 处理 DMG 文件
find "$TARGET_DIR/tauri-build-darwin-x86_64/dmg" -name "*.dmg" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-x86_64.dmg" \;
find "$TARGET_DIR/tauri-build-darwin-x86_64/dmg" -name "*.dmg.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-x86_64.dmg.sig" \;
# 如果没有找到 DMG 文件,检查是否有其他命名格式的 DMG
if [ ! -f "$UPLOAD_DIR/mytips-${VERSION}-x86_64.dmg" ]; then
find "$TARGET_DIR/tauri-build-darwin-x86_64" -name "*.dmg" -exec cp {} "$UPLOAD_DIR/mytips-${VERSION}-x86_64.dmg" \;
find "$TARGET_DIR/tauri-build-darwin-x86_64" -name "*.dmg.sig" -exec cp {} "$UPLOAD_DIR/mytips-${VERSION}-x86_64.dmg.sig" \;
fi
fi
# 查找并移动 macOS aarch64 产物
if [ -d "$TARGET_DIR/tauri-build-darwin-aarch64" ]; then
# 处理 .app.tar.gz 文件
find "$TARGET_DIR/tauri-build-darwin-aarch64/macos" -name "*.app.tar.gz" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-aarch64.app.tar.gz" \;
find "$TARGET_DIR/tauri-build-darwin-aarch64/macos" -name "*.app.tar.gz.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-aarch64.app.tar.gz.sig" \;
# 处理 DMG 文件
find "$TARGET_DIR/tauri-build-darwin-aarch64/dmg" -name "*.dmg" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-aarch64.dmg" \;
find "$TARGET_DIR/tauri-build-darwin-aarch64/dmg" -name "*.dmg.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-aarch64.dmg.sig" \;
# 如果没有找到 DMG 文件,检查是否有其他命名格式的 DMG
if [ ! -f "$UPLOAD_DIR/mytips-${VERSION}-aarch64.dmg" ]; then
find "$TARGET_DIR/tauri-build-darwin-aarch64" -name "*.dmg" -exec cp {} "$UPLOAD_DIR/mytips-${VERSION}-aarch64.dmg" \;
find "$TARGET_DIR/tauri-build-darwin-aarch64" -name "*.dmg.sig" -exec cp {} "$UPLOAD_DIR/mytips-${VERSION}-aarch64.dmg.sig" \;
fi
fi
# 查找并移动 Windows 产物 (NSIS)
if [ -d "$TARGET_DIR/tauri-build-windows-x86_64" ]; then
find "$TARGET_DIR/tauri-build-windows-x86_64/nsis" -name "*_x64-setup.exe" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-x64-setup.exe" \;
find "$TARGET_DIR/tauri-build-windows-x86_64/nsis" -name "*_x64-setup.exe.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-x64-setup.exe.sig" \;
find "$TARGET_DIR/tauri-build-windows-x86_64/nsis" -name "*_x64-setup.nsis.zip" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-x64-setup.nsis.zip" \;
find "$TARGET_DIR/tauri-build-windows-x86_64/nsis" -name "*_x64-setup.nsis.zip.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-x64-setup.nsis.zip.sig" \;
fi
# 查找并移动 Android 产物 (AAB 和 APK)
if [ -d "$TARGET_DIR/tauri-build-android" ]; then
# 处理 AAB 文件
find "$TARGET_DIR/tauri-build-android/" -name "*.aab" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-android-release.aab" \;
find "$TARGET_DIR/tauri-build-android/" -name "*.aab.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-android-release.aab.sig" \;
# 处理 APK 文件
find "$TARGET_DIR/tauri-build-android/" -name "*.apk" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-android-release.apk" \;
find "$TARGET_DIR/tauri-build-android/" -name "*.apk.sig" -exec mv {} "$UPLOAD_DIR/mytips-${VERSION}-android-release.apk.sig" \;
# 如果没有找到 APK 签名文件,检查是否有其他位置的签名文件
if [ ! -f "$UPLOAD_DIR/mytips-${VERSION}-android-release.apk.sig" ]; then
find "$TARGET_DIR/tauri-build-android/" -name "*.sig" | grep -E "apk|universal" | head -1 | xargs -I {} cp {} "$UPLOAD_DIR/mytips-${VERSION}-android-release.apk.sig" 2>/dev/null || true
fi
# 如果没有找到 AAB 签名文件,检查是否有其他位置的签名文件
if [ ! -f "$UPLOAD_DIR/mytips-${VERSION}-android-release.aab.sig" ]; then
find "$TARGET_DIR/tauri-build-android/" -name "*.sig" | grep -E "aab|bundle" | head -1 | xargs -I {} cp {} "$UPLOAD_DIR/mytips-${VERSION}-android-release.aab.sig" 2>/dev/null || true
fi
fi
# 显示移动后的文件状态
echo "Files in upload directory after moving:"
ls -la "$UPLOAD_DIR"
echo "Checking for signature files:"
find "$UPLOAD_DIR" -name "*.sig" -ls
# 重新生成清单文件,现在签名文件已经移动到正确位置
echo "Regenerating update manifest with actual signature files..."
UPLOAD_DIR="$UPLOAD_DIR" node scripts/generate-update-manifest.cjs
# 查找并移动清单文件
if [ -d "dist/update-manifests" ]; then
# 复制latest.json到根目录,确保它可以通过固定URL访问
if [ -f "dist/update-manifests/latest.json" ]; then
cp "dist/update-manifests/latest.json" "$UPLOAD_DIR/latest.json"
echo "Copied latest.json to upload directory"
fi
# 复制平台特定的清单文件
find dist/update-manifests -name "*.json" -exec cp {} "$UPLOAD_DIR/" \;
echo "Copied all platform-specific manifests to upload directory"
fi
# 显示所有待上传的文件
ls -l "$UPLOAD_DIR"
# 使用 gh cli 上传所有文件
if [ -n "$(ls -A "$UPLOAD_DIR")" ]; then
gh release upload ${{ github.ref_name }} "$UPLOAD_DIR"/*
else
echo "No files to upload."
fi