-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (95 loc) · 4.11 KB
/
build-unit-php.yml
File metadata and controls
96 lines (95 loc) · 4.11 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
name: Build PHP module for Nginx Unit
on:
workflow_dispatch:
inputs:
unit_version:
description: Nginx Unit version for which PHP language module should be built
required: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- debian_version: bookworm
php_major_version: 7
php_minor_version: 4
- debian_version: bookworm
php_major_version: 8
php_minor_version: 0
- debian_version: bookworm
php_major_version: 8
php_minor_version: 1
- debian_version: bookworm
php_major_version: 8
php_minor_version: 2
- debian_version: bookworm
php_major_version: 8
php_minor_version: 3
- debian_version: bookworm
php_major_version: 8
php_minor_version: 4
env:
unit_module_id: php${{ matrix.php_major_version }}${{ matrix.php_minor_version }}
unit_module_name: unit-php${{ matrix.php_major_version }}.${{ matrix.php_minor_version }}
container: ghcr.io/articus/unit-php-builder:${{ matrix.debian_version }}_${{ matrix.php_major_version }}.${{ matrix.php_minor_version }}_2025-08-03
steps:
- name: Workaround for https://git-scm.com/docs/git-config/2.39.2#Documentation/git-config.txt-safedirectory
run: chown root:root ./
- name: Checkout repository
uses: actions/checkout@v4
- name: Try to get Nginx Unit source code from cache
id: unit_cached_source
uses: actions/cache@v4
with:
key: unit-${{ github.event.inputs.unit_version }}
path: ./unit-code
- name: Download Nginx Unit source code from repository (https://github.com/nginx/unit/archive/refs/tags/*.tar.gz and https://sources.nginx.org/unit/*.tar.gz do no contain packaging scripts)
if: '!steps.unit_cached_source.outputs.cache-hit'
run: git clone --depth=1 --branch ${{ github.event.inputs.unit_version }} https://github.com/nginx/unit.git ./unit-code
- name: Register new PHP language module in Nginx Unit source code
run: |
cp ./Makefile.${{ env.unit_module_id }} ./unit-code/pkg/deb/
sed -i -r -e 's|(MODULES=)|\1\n\ninclude Makefile.${{ env.unit_module_id }}|' ./unit-code/pkg/deb/Makefile
sed -i -r -e 's|(unit-php)|\1 ${{ env.unit_module_name }}|g' ./unit-code/docs/changes.xml
sed -i -r -e 's|(unit-php) ?\t?|\1 ${{ env.unit_module_name }}|g' ./unit-code/docs/Makefile
- name: Build new PHP language module
run: make unit-${{ env.unit_module_id }}
working-directory: ./unit-code/pkg/deb
- name: Upload packages with new PHP language module
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.debian_version }}-${{ env.unit_module_id }}
path: ./unit-code/pkg/deb/debs/
publish:
needs:
- build
runs-on: ubuntu-latest
container: ghcr.io/articus/reprepro:2025-08-03
steps:
- name: Workaround for https://git-scm.com/docs/git-config/2.39.2#Documentation/git-config.txt-safedirectory
run: chown root:root ./
- name: Checkout repository
uses: actions/checkout@v4
- name: Download packages with new PHP language modules
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: ./debs
- name: Add private GPG key for package signature
run: |
echo "${{ secrets.SIGNING_KEY }}" | gpg --import
- name: Add packages to reprepro repository
run: |
for changes in $(find ./debs -name "*.deb")
do
reprepro --basedir=./reprepro --outdir=./docs includedeb $(echo "$changes" | grep -o -P '(?<=~)[^_.]+') $changes
done
- name: Save changes to branch with reprepro repository
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add --all
git commit -m "Packages for Nginx Unit ${{ github.event.inputs.unit_version }}"
git push