-
Notifications
You must be signed in to change notification settings - Fork 38
65 lines (54 loc) · 1.84 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: release
# on: workflow_dispatch
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
extensions: intl, zip, zlib, mbstring
coverage: none
ini-values: memory_limit=1G, phar.readonly=0
- name: Get composer cache directory
id: composer_release_cachedir
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer packages
id: composer-release-cache
uses: actions/cache@v2
with:
path: ${{ steps.composer_release_cachedir.outputs.dir }}
key: ${{ runner.os }}-release-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-release-
- name: Install
run: composer install --prefer-dist --no-interaction --no-ansi --no-progress --no-dev
- name: Install Box
run: composer global require humbug/box
- name: Validate config
run: box validate -i || exit 1
- name: Phar building
run: box compile -v || exit 1
- name: Phar test
run: test -f "./unused_scanner.phar" || exit 1
- name: Getting Tag Name
id: get-version
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/}
- name: Self-Test
run: ./unused_scanner.phar --version
- name: Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.get-version.outputs.version }}
tag: ${{ steps.get-version.outputs.version }}
body: 'Next stable release.'
allowUpdates: true
artifacts: unused_scanner.phar
artifactContentType: application/x-php