From 47c9f08d58b3f6d0147532101237f005aa532e86 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 27 Oct 2023 09:50:40 +0200 Subject: [PATCH 1/2] Add metapackage to avoid child dependency installs --- composer.json | 9 +++++++-- replacer/composer.json | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 replacer/composer.json diff --git a/composer.json b/composer.json index 4588aa3f..106a7d0f 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,15 @@ "cweagans/composer-patches": true } }, + "repositories": [ + { + "type": "path", + "url": "./replacer" + } + ], "require": { "php": ">=7.2", + "repl/acer": "@dev", "ipl/html": "^0.8.0", "ipl/i18n": "^0.2.0", "ipl/orm": "^0.6.0", @@ -25,8 +32,6 @@ "ipl/web": "^0.9.0", "cweagans/composer-patches": "~1.0" }, - "require-dev": { - }, "autoload": { "psr-0": { "AssetLoader": "" } }, diff --git a/replacer/composer.json b/replacer/composer.json new file mode 100644 index 00000000..53f9cdf7 --- /dev/null +++ b/replacer/composer.json @@ -0,0 +1,18 @@ +{ + "name": "repl/acer", + "type": "metapackage", + "description": "Replaces third party packages as they are included in icinga-php-thirdparty", + "license": "MIT", + "replace": { + "psr/http-message": "*", + "guzzlehttp/psr7": "*", + "dragonmantank/cron-expression": "*", + "psr/log": "*", + "ramsey/uuid": "*", + "react/event-loop": "*", + "react/promise": "*", + "simshaun/recurr": "*", + "evenement/evenement": "*", + "wikimedia/less.php": "*" + } +} From 7919fb80b6160a2e18b03749f3c0a62370eb2445 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 27 Oct 2023 09:51:08 +0200 Subject: [PATCH 2/2] Make sure no release contains thirdparty libraries --- .github/workflows/clean-vendor.yml | 26 ++++++++++++++++++++++++++ bin/make-release.sh | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/clean-vendor.yml diff --git a/.github/workflows/clean-vendor.yml b/.github/workflows/clean-vendor.yml new file mode 100644 index 00000000..7e61e23d --- /dev/null +++ b/.github/workflows/clean-vendor.yml @@ -0,0 +1,26 @@ +name: Clean Vendor Check + +on: + push: + branches: + - stable/* + +jobs: + check-vendor: + name: Clean Vendor Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code base + uses: actions/checkout@v3 + + - name: Check If Vendor Is Clean + run: | + files=`find vendor -maxdepth 1 -type d -not -name "ipl" -not -name "fortawesome" -not -name "composer" -not -name "vendor"` + if [ -z "$files" ]; then + echo "No unknown vendor files found"; + exit 0; + else + echo "Found unknown vendor files: $files"; + exit 1; + fi diff --git a/bin/make-release.sh b/bin/make-release.sh index 0cc9a6c0..9395242f 100755 --- a/bin/make-release.sh +++ b/bin/make-release.sh @@ -53,6 +53,12 @@ rm -rf vendor git checkout vendor composer validate --no-check-all --strict || fail "Composer validate failed" +UNKNOWN_VENDOR_FILES=$(find vendor -maxdepth 1 -type d -not -name "ipl" -not -name "fortawesome" -not -name "composer" -not -name "vendor") +if [ -n "$UNKNOWN_VENDOR_FILES" ]; then + echo "Unknown vendor files found! DO NOT TAG!" + exit 1 +fi + if [ -z "$NO_OPT" ]; then git tag -a v$VERSION -m "Version v$VERSION" echo "Finished, tagged v$VERSION"