diff --git a/publish_to_gitea.sh b/publish_to_gitea.sh index 4513f57..3ba0348 100755 --- a/publish_to_gitea.sh +++ b/publish_to_gitea.sh @@ -35,7 +35,14 @@ fi # Create a ZIP file from the project directory ZIP_NAME="package-$(date +%Y%m%d%H%M%S).zip" -zip -r $ZIP_NAME $PROJECT_DIR +#zip -r "$ZIP_NAME" "$PROJECT_DIR" -x "*vendor/*" || { echo "Failed to create ZIP file"; exit 1; } +# Change to the project directory +cd "$PROJECT_DIR" || { echo "Failed to enter project directory $PROJECT_DIR"; exit 1; } + +# Use git archive to respect .gitignore and exclude .git +git archive --format=zip -o "../$ZIP_NAME" HEAD + +cd .. # Check if version is provided if [ -z "$VERSION" ]; then