-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (78 loc) · 2.72 KB
/
release.yml
File metadata and controls
95 lines (78 loc) · 2.72 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
# This file is part of the PPCRE.
#
# (c) Serghei Iakovlev <egrep@protonmail.ch>
#
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.
name: release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set Environment Variables
uses: allenevans/set-env@v1.0.0
with:
BOX_VERSION: '3.8.4'
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
extensions: intl, zip, zlib
coverage: none
ini-values: memory_limit=1G, phar.readonly=0
# Ensure that deps will work on lowest supported PHP version
- name: Choose a Suitable PHP Version to Build PHAR
run: composer config platform.php 7.0.33
- name: Get Composer Cache Directory
id: composer-cache
run: echo ::set-output name=dir::$(composer config cache-files-dir)
- name: Setup Composer Cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup Composer Token
run: |
if [ ! -z '${{ secrets.COMPOSER_TOKEN }}' ]; then
composer config github-oauth.github.com ${{ secrets.COMPOSER_TOKEN }}
fi
- name: Install Project Dependencies
run: composer install --prefer-dist --no-interaction --no-ansi --no-progress --no-suggest
- name: Install Box
run: |
wget \
"https://github.com/humbug/box/releases/download/${BOX_VERSION}/box.phar" \
--quiet \
-O ./box
chmod +x ./box
sudo mv ./box /usr/local/bin
- name: Build Application PHAR
run: .github/build-phar.sh
- name: Geting Tag Name
id: get-version
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/}
- name: Self-Test
run: ./example.phar --version
- name: Create Release
uses: ncipollo/release-action@v1
with:
# This token is provided by GitHub Actions.
# You DO NOT need to create your own token.
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.get-version.outputs.version }}
tag: ${{ steps.get-version.outputs.version }}
body: 'Next stable release.'
# This will update existing tags if any
allowUpdates: true
artifacts: example.phar
artifactContentType: application/x-php