-
Notifications
You must be signed in to change notification settings - Fork 23
126 lines (104 loc) · 3.14 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
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
125
126
name: Build and test phar
on:
push:
tags:
- 'v*'
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
bundle:
# Don't run on forks.
if: github.repository == 'php-parallel-lint/PHP-Parallel-Lint'
name: Bundle binary
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: exif, phar, openssl
coverage: none
ini-values: phar.readonly=Off, error_reporting=-1, display_errors=On, zend.assertions=1
- name: Install Composer dependencies
uses: ramsey/composer-install@v1
with:
composer-options: "--no-dev"
- name: Install Box
run: wget https://github.com/humbug/box/releases/latest/download/box.phar -O box.phar && chmod 0755 box.phar && pwd
- name: Validate configuration
run: php box.phar validate -i box.json
- name: Building binary...
run: php box.phar compile -v --config=box.json
- name: Show info about the build phar with humbug/box
run: php box.phar info -l parallel-lint.phar
- uses: actions/upload-artifact@v2
with:
name: parallel-lint-phar
path: ./parallel-lint.phar
verify:
name: Validate binary on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.php == '8.2' }}
needs:
- bundle
strategy:
matrix:
php:
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: parallel-lint-phar
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=-1, display_errors=On, zend.assertions=1
coverage: none
- name: Run linter against codebase
run: php ./parallel-lint.phar src/
publish:
name: Add binary to release
runs-on: ubuntu-latest
needs:
- bundle
- verify
steps:
- uses: actions/download-artifact@v2
with:
name: parallel-lint-phar
- name: Draft Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Phar as Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: parallel-lint.phar