@@ -286,64 +286,20 @@ jobs:
286286 ${{ env.GOOS == 'windows' && format('{0}.zip', env.DIST) || '' }}
287287 ${{ env.GOOS == 'windows' && format('{0}.zip.digest', env.DIST) || '' }}
288288
289- - name : Set up nodejs
290- uses : actions/setup-node@v4
291- with :
292- node-version : current
293-
294- - name : Install dependencies
295- run : |
296- corepack enable
297- corepack prepare pnpm@latest --activate
298-
299- - name : Upload to R2
289+ - name : Upload to R2 using S3 API
300290 if : github.event_name != 'pull_request' && github.ref == 'refs/heads/dev'
301- uses : cloudflare/wrangler-action@v3
302291 env :
303- WRANGLER_LOG : debug
304- WRANGLER_LOG_SANITIZE : false
305- with :
306- accountId : ${{ secrets.CF_ACCOUNT_ID }}
307- apiToken : ${{ secrets.CF_R2_API_TOKEN }}
308- wranglerVersion : " 4.23.0"
309- command : |
310- r2 object put nginx-ui-dev-build/${{ env.DIST }}.tar.gz --file ./${{ env.DIST }}.tar.gz --remote
311- r2 object put nginx-ui-dev-build/${{ env.DIST }}.tar.gz.digest --file ./${{ env.DIST }}.tar.gz.digest --remote
312-
313- - name : Print Wrangler logs for debugging
314- if : always() && (github.event_name != 'pull_request' && github.ref == 'refs/heads/dev')
292+ AWS_ACCESS_KEY_ID : ${{ secrets.R2_ACCESS_KEY_ID }}
293+ AWS_SECRET_ACCESS_KEY : ${{ secrets.R2_SECRET_ACCESS_KEY }}
294+ AWS_REGION : us-east-1
315295 run : |
316- echo "=== Searching for Wrangler log files ==="
317- LOG_DIR="$HOME/.config/.wrangler/logs"
318- if [ -d "$LOG_DIR" ]; then
319- echo "Found Wrangler logs directory: $LOG_DIR"
320- echo "Files in logs directory:"
321- ls -la "$LOG_DIR"
322-
323- echo ""
324- echo "=== Printing content of all log files ==="
325- for log_file in "$LOG_DIR"/wrangler-*.log; do
326- if [ -f "$log_file" ]; then
327- echo "--- Content of $log_file ---"
328- cat "$log_file"
329- echo ""
330- fi
331- done
332- else
333- echo "Wrangler logs directory not found at $LOG_DIR"
334- echo "Checking alternative locations..."
335- find $HOME -name "wrangler-*.log" -type f 2>/dev/null || echo "No wrangler log files found"
336- fi
296+ echo "Uploading ${{ env.DIST }}.tar.gz to R2..."
297+ aws s3 cp ./${{ env.DIST }}.tar.gz s3://nginx-ui-dev-build/${{ env.DIST }}.tar.gz --endpoint-url=${{ secrets.R2_S3_API_ENDPOINT }}
298+
299+ echo "Uploading ${{ env.DIST }}.tar.gz.digest to R2..."
300+ aws s3 cp ./${{ env.DIST }}.tar.gz.digest s3://nginx-ui-dev-build/${{ env.DIST }}.tar.gz.digest --endpoint-url=${{ secrets.R2_S3_API_ENDPOINT }}
337301
338- echo ""
339- echo "=== Environment and system info ==="
340- echo "Current user: $(whoami)"
341- echo "Home directory: $HOME"
342- echo "Current working directory: $(pwd)"
343- echo "Disk usage:"
344- df -h
345- echo "Available space in home:"
346- du -sh $HOME 2>/dev/null || echo "Cannot check home directory size"
302+ echo "Upload completed successfully"
347303
348304 docker-build :
349305 if : github.event_name != 'pull_request'
0 commit comments