-
Notifications
You must be signed in to change notification settings - Fork 17
65 lines (55 loc) · 1.71 KB
/
release.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
56
57
58
59
60
61
62
63
64
65
name: Automatic Releases
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Setup PHP 7.1
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
- name: Environment
run: |
env
- name: Get Source Code
uses: actions/checkout@v2
- name: Get Composer Dependencies
run: |
composer install --no-dev
# Manually fix the zend-stdlib issue
(cd vendor/zendframework/zend-stdlib/; patch -p1 < ../../../.patches/zend-stdlib.patch)
- name: Build Phar file
run: php -d phar.readonly=0 bin/create-phar.php
- name: Test Phar file
run: |
(cp bin/zs-client.phar /tmp && \
/tmp/zs-client.phar targetFileLocation && \
rm /tmp/zs-client.phar
)
- name: Build ZPK file
run: php ./bin/build-zpk.php
- name: Store compiled Phar and ZPK files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${GITHUB_REF_NAME}" != "master" ]; then
echo "Not on master branch, skipping upload";
exit 0;
fi
set -x
DIFF=$(git diff bin/zs-client.phar build/ZendServerSDK.zpk)
if [ -n "$DIFF" ]; then
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git config user.email "release@zend.com"
git config user.name "Automated Release"
git stash
git fetch origin ${GITHUB_REF_NAME}
git checkout ${GITHUB_REF_NAME}
git stash pop
git commit -a -m "Update phar and zpk"
git push origin ${GITHUB_REF_NAME}
fi