Replace "branch-version" by "versions" in composer.json

This commit is contained in:
Nicolas Grekas 2021-01-27 14:48:15 +01:00
parent 22b1eb40a3
commit b40e71f096
11 changed files with 17 additions and 17 deletions

View File

@ -50,9 +50,10 @@ install:
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex - php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex
- git config --global user.email "" - git config --global user.email ""
- git config --global user.name "Symfony" - git config --global user.name "Symfony"
- FOR /F "tokens=* USEBACKQ" %%F IN (`bash -c "grep branch-version composer.json | grep -o '[0-9.x]*'"`) DO (SET SYMFONY_VERSION=%%F) - FOR /F "tokens=* USEBACKQ" %%F IN (`bash -c "grep -m1 SYMFONY_VERSION .travis.yml | grep -o '[0-9.x]*'"`) DO (SET SYMFONY_VERSION=%%F)
- php .github/build-packages.php HEAD^ %SYMFONY_VERSION% src\Symfony\Bridge\PhpUnit - php .github/build-packages.php HEAD^ %SYMFONY_VERSION% src\Symfony\Bridge\PhpUnit
- SET "SYMFONY_REQUIRE=>=%SYMFONY_VERSION%" - SET "SYMFONY_REQUIRE=>=%SYMFONY_VERSION%"
- SET COMPOSER_ROOT_VERSION=%SYMFONY_VERSION%.x-dev
- php composer.phar update --no-progress --ansi - php composer.phar update --no-progress --ansi
- php phpunit install - php phpunit install

View File

@ -46,7 +46,7 @@ foreach ($dirs as $k => $dir) {
passthru("cd $dir && git init && git add . && git commit -q -m - && git archive -o package.tar HEAD && rm .git/ -Rf"); passthru("cd $dir && git init && git add . && git commit -q -m - && git archive -o package.tar HEAD && rm .git/ -Rf");
} }
$package->version = (isset($package->extra->{'branch-version'}) ? $package->extra->{'branch-version'} : $version).'.x-dev'; $package->version = preg_replace('/(?:\.x)?-dev$/', '', $package->extra->{'branch-alias'}->{'dev-main'} ?? $version).'.x-dev';
$package->dist['type'] = 'tar'; $package->dist['type'] = 'tar';
$package->dist['url'] = 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__))."/$dir/package.tar"; $package->dist['url'] = 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__))."/$dir/package.tar";

View File

@ -80,8 +80,9 @@ jobs:
- name: Configure composer - name: Configure composer
run: | run: |
COMPOSER_HOME="$(composer config home)" COMPOSER_HOME="$(composer config home)"
composer self-update
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json" ([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
echo "COMPOSER_ROOT_VERSION=$(grep branch-version composer.json | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV echo "COMPOSER_ROOT_VERSION=$(grep -m1 SYMFONY_VERSION .travis.yml | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV
- name: Determine composer cache directory - name: Determine composer cache directory
id: composer-cache id: composer-cache

View File

@ -14,6 +14,7 @@ addons:
env: env:
global: global:
- SYMFONY_VERSION=4.4
- MIN_PHP=7.1.3 - MIN_PHP=7.1.3
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/shims/php - SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/shims/php
- SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1 - SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
@ -170,8 +171,8 @@ install:
git fetch --depth=2 origin refs/pull/$SYMFONY_PHPUNIT_BRIDGE_PR/head git fetch --depth=2 origin refs/pull/$SYMFONY_PHPUNIT_BRIDGE_PR/head
git rm -rq src/Symfony/Bridge/PhpUnit git rm -rq src/Symfony/Bridge/PhpUnit
git checkout -q FETCH_HEAD -- src/Symfony/Bridge/PhpUnit git checkout -q FETCH_HEAD -- src/Symfony/Bridge/PhpUnit
export SYMFONY_VERSION=$(curl -s https://api.github.com/repos/symfony/symfony/pulls/$SYMFONY_PHPUNIT_BRIDGE_PR | jq -r .base.ref) SYMFONY_PHPUNIT_BRIDGE_REF=$(curl -s https://api.github.com/repos/symfony/symfony/pulls/$SYMFONY_PHPUNIT_BRIDGE_PR | jq -r .base.ref)
sed -i 's/"symfony\/phpunit-bridge": ".*"/"symfony\/phpunit-bridge": "'$SYMFONY_VERSION'.x@dev"/' composer.json sed -i 's/"symfony\/phpunit-bridge": ".*"/"symfony\/phpunit-bridge": "'$SYMFONY_PHPUNIT_BRIDGE_REF'.x@dev"/' composer.json
rm -rf .phpunit rm -rf .phpunit
fi fi
@ -180,7 +181,6 @@ install:
git config --global user.email "" git config --global user.email ""
git config --global user.name "Symfony" git config --global user.name "Symfony"
export SYMFONY_VERSION=$(grep branch-version composer.json | grep -o '[0-9.x]*')
SYMFONY_VERSIONS=$(git ls-remote -q --heads); SYMFONY_VERSIONS=$(git ls-remote -q --heads);
if [[ ! $deps ]]; then if [[ ! $deps ]]; then
@ -227,6 +227,7 @@ install:
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one # Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(echo "$SYMFONY_VERSIONS" | cut -f2 | grep -FA1 /$SYMFONY_VERSION | tail -n 1 | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy [[ $deps = high && ${SYMFONY_VERSION%.*} != $(echo "$SYMFONY_VERSIONS" | cut -f2 | grep -FA1 /$SYMFONY_VERSION | tail -n 1 | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi
- | - |
@ -265,6 +266,7 @@ install:
export FLIP='^' export FLIP='^'
SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}') SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}')
echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m" echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m"
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION" export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
git fetch --depth=2 origin $SYMFONY_VERSION git fetch --depth=2 origin $SYMFONY_VERSION
git checkout -m FETCH_HEAD git checkout -m FETCH_HEAD

View File

@ -156,11 +156,13 @@
"repositories": [ "repositories": [
{ {
"type": "path", "type": "path",
"url": "src/Symfony/Contracts" "url": "src/Symfony/Contracts",
"options": {
"versions": {
"symfony/contracts": "1.1.x-dev"
}
}
} }
], ],
"minimum-stability": "dev", "minimum-stability": "dev"
"extra": {
"branch-version": "4.4"
}
} }

View File

@ -33,7 +33,6 @@
} }
}, },
"extra": { "extra": {
"branch-version": "1.1",
"branch-alias": { "branch-alias": {
"dev-main": "1.1-dev" "dev-main": "1.1-dev"
} }

View File

@ -33,7 +33,6 @@
} }
}, },
"extra": { "extra": {
"branch-version": "1.1",
"branch-alias": { "branch-alias": {
"dev-main": "1.1-dev" "dev-main": "1.1-dev"
} }

View File

@ -32,7 +32,6 @@
} }
}, },
"extra": { "extra": {
"branch-version": "1.1",
"branch-alias": { "branch-alias": {
"dev-main": "1.1-dev" "dev-main": "1.1-dev"
} }

View File

@ -33,7 +33,6 @@
} }
}, },
"extra": { "extra": {
"branch-version": "1.1",
"branch-alias": { "branch-alias": {
"dev-main": "1.1-dev" "dev-main": "1.1-dev"
} }

View File

@ -32,7 +32,6 @@
} }
}, },
"extra": { "extra": {
"branch-version": "1.1",
"branch-alias": { "branch-alias": {
"dev-main": "1.1-dev" "dev-main": "1.1-dev"
} }

View File

@ -46,7 +46,6 @@
}, },
"minimum-stability": "dev", "minimum-stability": "dev",
"extra": { "extra": {
"branch-version": "1.1",
"branch-alias": { "branch-alias": {
"dev-main": "1.1-dev" "dev-main": "1.1-dev"
} }