forked from shivammathur/composer-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.65 KB
/
Copy pathpatch.yml
File metadata and controls
51 lines (51 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: 'Patch'
on:
workflow_dispatch:
inputs:
composer-version:
description: composer version
required: true
jobs:
patch:
runs-on: ubuntu-latest
env:
version: ${{ github.event.inputs.composer-version }}
GITHUB_WORKSPACE: ${{ github.workspace }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: latest
- name: Fetch
run: |
tag="$(curl -sL https://github.com/shivammathur/composer-cache/releases/latest/download/versions | jq -r ".[\"${version}\"][0].version")"
git clone https://github.com/composer/composer "/tmp/composer-$version"
cd "/tmp/composer-$version" || exit 1
git checkout "$tag"
- name: Patch
run: |
cd "/tmp/composer-$version" || exit 1
for patch in "$GITHUB_WORKSPACE"/patches/*.patch; do
git apply "$patch" || true
done
- name: Composer Install
run: |
cd "/tmp/composer-$version" || exit 1
composer install --ansi --no-interaction --no-progress --no-suggest --prefer-dist
- name: Build
run: |
cd "/tmp/composer-$version" || exit 1
php -d phar.readonly=0 bin/compile
- name: Smoke Test
run: |
cd "/tmp/composer-$version" || exit 1
php ./composer.phar -V
- name: Release
run: |
cd "$GITHUB_WORKSPACE" || exit 1
sudo cp "/tmp/composer-$version/composer.phar" "./composer-$version.phar"
gh release upload "versions" "./composer-$version.phar" --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}