From b8674dc3630126c6cb858155edfeeeb95baa4cfe Mon Sep 17 00:00:00 2001 From: Mohamed Youssef Date: Sun, 2 Aug 2026 09:44:57 +0300 Subject: [PATCH] update --- .gitea/workflows/release.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 97f8080..0affe51 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -57,25 +57,23 @@ jobs: - name: Get plugin version and slug id: meta run: | - MAIN_FILE=$(grep -l "Plugin Name:" *.php | head -n 1) + MAIN_FILE=$(find . -maxdepth 3 -type f -name "*.php" -exec grep -l "Plugin Name:" {} \; | head -n 1) if [ -z "$MAIN_FILE" ]; then - echo "❌ No main plugin file (with 'Plugin Name:') found!" >&2 + echo "❌ No plugin file with 'Plugin Name:' found!" >&2 exit 1 fi - + MAIN_FILE=${MAIN_FILE#./} VERSION=$(grep "^Version:" "$MAIN_FILE" | awk -F' ' '{print $NF}' | tr -d '\r') if [ -z "$VERSION" ]; then echo "❌ Version header not found in $MAIN_FILE" >&2 exit 1 fi - - # Use repository name as the plugin slug SLUG="${GITHUB_REPOSITORY##*/}" - echo "PLUGIN_SLUG=$SLUG" >> $GITHUB_ENV echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV echo "FILENAME=${SLUG}-${VERSION}.zip" >> $GITHUB_ENV - echo "✅ Plugin: $SLUG, Version: $VERSION" + echo "MAIN_FILE=$MAIN_FILE" >> $GITHUB_ENV + echo "✅ Plugin: $SLUG, Version: $VERSION (main file: $MAIN_FILE)" # -------------------------------- # Prepare package (exclude dev files) @@ -83,8 +81,6 @@ jobs: - name: Prepare package directory run: | mkdir -p /tmp/build/${{ env.PLUGIN_SLUG }} - - # If you have a .distignore file, use: --exclude-from='.distignore' rsync -av \ --exclude='.git' \ --exclude='.github' \ @@ -107,10 +103,8 @@ jobs: --exclude='.wordpress-org' \ ./ /tmp/build/${{ env.PLUGIN_SLUG }}/ 2>/dev/null || true - # Adjust excludes if your plugin needs any of these files in production. - # -------------------------------- - # Create ZIP archive + # Create ZIP # -------------------------------- - name: Create plugin zip run: | @@ -122,7 +116,7 @@ jobs: # -------------------------------- # Install & configure tea CLI # -------------------------------- - - name: Install tea CLI (pinned version) + - name: Install tea CLI run: | curl -L https://dl.gitea.io/tea/0.11.0/tea-0.11.0-linux-amd64 -o tea chmod +x tea @@ -136,18 +130,15 @@ jobs: --token "${{ secrets.GITEA_TOKEN }}" # -------------------------------- - # Create or force‑update Gitea release + # Create/force‑update Gitea release # -------------------------------- - name: Create/update Gitea release run: | TAG="v${{ env.PLUGIN_VERSION }}" REPO="${{ vars.GITEA_REPO }}" - - # --force will overwrite an existing release with the same tag tea release create "$TAG" \ --title "${{ env.PLUGIN_SLUG }} v${{ env.PLUGIN_VERSION }}" \ --asset "${{ env.FILENAME }}" \ --repo "$REPO" \ --force - echo "✅ Release $TAG created/updated with asset ${{ env.FILENAME }}" \ No newline at end of file