-
Notifications
You must be signed in to change notification settings - Fork 13
50 lines (40 loc) · 1.11 KB
/
publish.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
name: Publish phar file
on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
publish:
name: Publish phar file
runs-on: 'ubuntu-latest'
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2
- name: Run linter
run: composer test
- name: Install humbug/box
run: composer phar:install-tools
- name: Install dependencies
run: composer install --prefer-dist --no-dev --no-interaction
- name: Build phar file
run: composer phar:build
- name: Upload phar to release
if: ${{ github.ref_name != 'master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.ref_name }} diffy.phar
- name: Archive diffy.phar
if: ${{ github.ref_name == 'master' }}
uses: actions/upload-artifact@v3
with:
name: diffy.phar
path: diffy.phar