-
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (77 loc) · 2.88 KB
/
build.yml
File metadata and controls
99 lines (77 loc) · 2.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
name: Build application
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag version'
required: true
workflow_call:
inputs:
tag:
type: string
required: true
permissions:
contents: write
pull-requests: write
env:
TAG_NAME: ${{ inputs.tag || github.event.inputs.tag }}
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Detect version
run: echo "New versions is $TAG_NAME"
- name: Checkout the code
uses: actions/checkout@v6
- 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: xdebug
- name: Install the dependencies
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
- name: Run tests
run: composer test
- name: Create the PHAR file
run: php ./notifications app:build notifications --build-version=$TAG_NAME --ansi
- name: Show version
run: php builds/notifications --version
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: notifications
path: builds/notifications
retention-days: 1
pull_request:
runs-on: ubuntu-latest
needs: build
name: Create a Pull Request
steps:
- name: Checkout the code
uses: actions/checkout@v6
- name: Make a title
id: title
run: |
echo "title=🏗️ Build the application version ${TAG_NAME}" >> "$GITHUB_OUTPUT"
- name: Show title
run: echo ${{ steps.title.outputs.title }}
- name: Remove old file
run: rm -f builds/notifications
- uses: actions/download-artifact@v8
with:
name: notifications
path: builds
- name: Create a Pull Request
uses: peter-evans/create-pull-request@v8
with:
branch: build/app
branch-suffix: random
delete-branch: true
add-paths: ./builds/notifications
title: ${{ steps.title.outputs.title }}
commit-message: ${{ steps.title.outputs.title }}
body: Application compiled successfully
labels: build