Skip to content

Commit cf7c344

Browse files
committed
feat(build): added automatic building of Phar on version release
1 parent 49fca21 commit cf7c344

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

.github/workflows/php-package.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: PHP Package
2+
env:
3+
PHAR_TOOL_VERSION: 1.4.0
4+
PHAR_TOOL_REPOSITORY: clue/phar-composer
25
on:
36
push:
47
pull_request:
@@ -26,19 +29,24 @@ jobs:
2629
php-version:
2730
- 8.2
2831
- 8.3
29-
io-driver:
30-
- eio
31-
- uv
32+
- 8.4
3233
steps:
3334
- uses: actions/checkout@v4
3435
- name: Setup PHP
3536
uses: shivammathur/setup-php@v2
3637
with:
3738
php-version: ${{ matrix.php-version }}
38-
extensions: ${{ matrix.io-driver }}
3939
tools: composer:v2
4040
coverage: xdebug3
4141
- run: composer install
4242
shell: bash
4343
- run: composer test
4444
shell: bash
45+
- name: Download build package
46+
run: gh release download v${{ env.PHAR_TOOL_VERSION }} -R=${{ env.PHAR_TOOL_REPOSITORY }}
47+
shell: bash
48+
- name: Build package
49+
run: |
50+
chmod +x ./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar
51+
./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar build ./ mysql2json
52+
shell: bash

.github/workflows/release-please.yml

+29-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ on:
22
push:
33
branches:
44
- main
5+
env:
6+
PHAR_TOOL_VERSION: 1.4.0
7+
PHAR_TOOL_REPOSITORY: clue/phar-composer
58

69
permissions:
710
contents: write
@@ -15,7 +18,32 @@ jobs:
1518
release-please:
1619
needs: verify-release
1720
runs-on: ubuntu-24.04
21+
outputs:
22+
releases_created: ${{ steps.release.outputs.release_created }}
23+
tag: ${{ steps.release.outputs.tag_name }}
1824
steps:
1925
- uses: googleapis/release-please-action@v4
26+
id: release
2027
with:
21-
release-type: php
28+
release-type: php
29+
upload_phar:
30+
needs: release-please
31+
runs-on: ubuntu-24.04
32+
if: ${{ needs.release-please.outputs.releases_created == true }}
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
ref: ${{ needs.release-please.outputs.tag }}
37+
- name: Setup PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: 8.2
41+
tools: composer:v2
42+
- name: Download build package
43+
run: gh release download v${{ env.PHAR_TOOL_VERSION }} -R=${{ env.PHAR_TOOL_REPOSITORY }}
44+
- name: Build package
45+
run: |
46+
chmod +x ./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar
47+
./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar build ./ mysql2json
48+
- name: Upload package
49+
run: gh release upload ${{ needs.release-please.outputs.tag }} mysql2json

0 commit comments

Comments
 (0)