-
Notifications
You must be signed in to change notification settings - Fork 191
55 lines (55 loc) · 2.16 KB
/
createzip.yml
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
52
53
54
55
name: Installable Plugin
on:
release:
types: [published]
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: none
- name: Build project
run: |
wget https://github.com/humbug/php-scoper/releases/download/0.13.10/php-scoper.phar
rm -rf build/*
#
# First, revert to Guzzle 6 and install all dependencies. Then prefix everything
# with humbug/php-scoper. Finally, we should dump the autoloader again to update
# the autoloader with the new classnames.
#
sed -i.bak 's/guzzle": "^6.3 || ^7.0"/guzzle": "^6.3"/g' composer.json
composer install --no-dev --no-scripts --no-suggest
php php-scoper.phar add-prefix --force
composer dump-autoload --working-dir build --classmap-authoritative
php build/examples/initialize.php
#
# Now move the autoload files. We have to use the scoper one to load the aliasses but we want to load the normal
# filename. Flip them around.
#
mv build/vendor/autoload.php build/vendor/composer-autoload.php
sed -i.bak 's/autoload.php/composer-autoload.php/g' build/vendor/scoper-autoload.php
mv build/vendor/scoper-autoload.php build/vendor/autoload.php
- name: Install zip
uses: montudor/[email protected]
- name: Finally, create a zip file with all built files.
run: zip -r mollie-api-php.zip examples src vendor composer.json LICENSE README.md
working-directory: build
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: mollie-api-php
path: build/mollie-api-php.zip
- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: build/mollie-api-php.zip application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}