CI: Fix Composer root version guessing
This commit is contained in:
parent
070714d1d8
commit
dde3a76d78
35
.github/actions/install/action.yml
vendored
35
.github/actions/install/action.yml
vendored
@ -35,21 +35,6 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
composer config --global github-oauth.github.com "${{ github.token }}"
|
composer config --global github-oauth.github.com "${{ github.token }}"
|
||||||
|
|
||||||
- name: Setup Composer root version
|
|
||||||
if: ${{ github.ref_type == 'branch' }}
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ inputs.path }}
|
|
||||||
run: |
|
|
||||||
COMPOSER_ROOT_VERSION=
|
|
||||||
|
|
||||||
if [ -z "$(composer config extra.branch-alias."dev-${GITHUB_HEAD_REF:-GITHUB_REF_NAME}" 2> /dev/null)" ]; then
|
|
||||||
COMPOSER_ROOT_VERSION="$(php -r "
|
|
||||||
require('./lib/Pico.php');
|
|
||||||
echo preg_replace('/\.[0-9]+-dev$/', '.x-dev', Pico::VERSION);
|
|
||||||
")"
|
|
||||||
echo "COMPOSER_ROOT_VERSION=$COMPOSER_ROOT_VERSION" | tee -a "$GITHUB_ENV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Get Composer cache directory
|
- name: Get Composer cache directory
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ inputs.path }}
|
working-directory: ${{ inputs.path }}
|
||||||
@ -65,6 +50,26 @@ runs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-composer-
|
${{ runner.os }}-composer-
|
||||||
|
|
||||||
|
- name: Setup Composer root version
|
||||||
|
if: ${{ github.ref_type == 'branch' }}
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ inputs.path }}
|
||||||
|
run: |
|
||||||
|
COMPOSER_ROOT_VERSION=
|
||||||
|
|
||||||
|
COMPOSER_ROOT_VERSION="$(composer config \
|
||||||
|
extra.branch-alias."dev-${GITHUB_HEAD_REF:-GITHUB_REF_NAME}" \
|
||||||
|
2> /dev/null)"
|
||||||
|
|
||||||
|
if [ -z "$COMPOSER_ROOT_VERSION" ]; then
|
||||||
|
COMPOSER_ROOT_VERSION="$(php -r "
|
||||||
|
require('./lib/Pico.php');
|
||||||
|
echo preg_replace('/\.[0-9]+-dev$/', '.x-dev', Pico::VERSION);
|
||||||
|
")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "COMPOSER_ROOT_VERSION=$COMPOSER_ROOT_VERSION" | tee -a "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Install Composer dependencies
|
- name: Install Composer dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ inputs.path }}
|
working-directory: ${{ inputs.path }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user