This repository was archived by the owner on May 27, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (95 loc) · 3.88 KB
/
Copy pathbuild.yml
File metadata and controls
124 lines (95 loc) · 3.88 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Build application
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag version'
required: true
permissions: write-all
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Extract the tag version
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
GITHUB_REF=${{ github.event.inputs.tag }}
fi
echo "tag=${GITHUB_REF##*v}" >> "$GITHUB_OUTPUT"
- name: Checkout the code
uses: actions/checkout@v6
with:
submodules: true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json, dom, curl, libxml, fileinfo, tokenizer, xml
ini-values: error_reporting=E_ALL
coverage: none
- name: Install the dependencies
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
- name: Execute unit/feature tests
run: sudo php ./iconify
- name: Create the PHAR file
run: php ./iconify app:build iconify --build-version=${{ steps.tag.outputs.tag }} --ansi
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: iconify
path: builds/iconify
retention-days: 1
checks:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: true
matrix:
php: [ "8.2", "8.3", "8.4" ]
name: Check PHP ${{ matrix.php }}
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json, dom, curl, libxml, fileinfo, tokenizer, xml
ini-values: error_reporting=E_ALL
coverage: none
- name: Remove old file from Ubuntu
run: rm -f builds/iconify
- uses: actions/download-artifact@v8
with:
name: iconify
path: builds
- name: Show version
run: php builds/iconify --version
push:
runs-on: ubuntu-latest
needs: checks
steps:
- name: Checkout the code
uses: actions/checkout@v6
- name: Remove old file
run: rm -f builds/iconify
- uses: actions/download-artifact@v8
with:
name: iconify
path: builds
- name: Git setup
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --global core.autocrlf false
git config --global core.eol lf
- name: Commit the PHAR file
id: build
run: |
IS_DIRTY=1
{ git add ./builds/iconify && git commit -a -m "🏗️ Build application"; } || IS_DIRTY=0
echo "is_dirty=${IS_DIRTY}" >> "$GITHUB_OUTPUT"
- name: Push changes
uses: ad-m/github-push-action@master
if: steps.build.outputs.is_dirty == 1
with:
github_token: ${{ secrets.COMPOSER_TOKEN }}