diff --git a/.distignore b/.distignore index bb4dde0..18be797 100644 --- a/.distignore +++ b/.distignore @@ -4,6 +4,7 @@ README.md /node_modules /src /.wordpress-org +/.idea .distignore .eslintrc.js diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 8e98ca2..23ab1f8 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -29,18 +29,25 @@ jobs: echo "Tag: $tag" echo "tag=$tag" >> $GITHUB_ENV - - name: Prepare Plugin ZIP - run: | - plugin_name="ootb-openstreetmap" - mkdir -p "$plugin_name" - - # Sync files but exclude the ZIP file itself and the output directory - rsync -av --exclude=".distignore" \ - --exclude="${plugin_name}-${tag}.zip" \ - --exclude="$plugin_name/" ./ "$plugin_name/" - - # Create the ZIP - zip -r "${plugin_name}-${tag}.zip" "$plugin_name" + - name: Prepare Plugin ZIP + run: | + plugin_name="ootb-openstreetmap" + mkdir -p "$plugin_name" + + # Create exclusion rules from `.distignore` + if [[ -f ".distignore" ]]; then + rsync_exclude_option="--exclude-from=.distignore" + else + rsync_exclude_option="" + fi + + # Sync files but exclude the ZIP file itself and the output directory + rsync -av $rsync_exclude_option \ + --exclude="${plugin_name}-${tag}.zip" \ + --exclude="$plugin_name/" ./ "$plugin_name/" + + # Create the ZIP + zip -r "${plugin_name}-${tag}.zip" "$plugin_name" - name: Create release env: