Skip to content

Commit 1e7ab92

Browse files
Creating a phar artifact when releasing (#36)
1 parent 7d625f2 commit 1e7ab92

2 files changed

Lines changed: 64 additions & 2 deletions

File tree

.github/workflows/phar-build.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: 'Build and Release PHAR'
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build-phar:
10+
name: Build PHAR
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.2'
21+
extensions: json, fileinfo
22+
tools: composer
23+
24+
- name: Install dependencies
25+
run: composer install --no-dev --optimize-autoloader
26+
27+
- name: Build PHAR
28+
run: composer build-phar
29+
30+
- name: Upload PHAR artifact
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: phpcca.phar
34+
path: phpcca.phar
35+
36+
release:
37+
name: Create Release
38+
needs: build-phar
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- name: Download PHAR artifact
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: phpcca.phar
46+
47+
- name: Create GitHub Release
48+
uses: ncipollo/release-action@v1
49+
with:
50+
artifacts: phpcca.phar
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
tag: ${{ github.ref_name }}
53+
name: Release ${{ github.ref_name }}
54+
draft: true
55+
generateReleaseNotes: true

box.json.dist

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
2-
"main": "./analyse.php",
2+
"main": "./bin/phpcca",
33
"compression": "GZ",
4-
"output": "phpcca.phar"
4+
"output": "phpcca.phar",
5+
"force-autodiscovery": true,
6+
"files": [
7+
"config.yml",
8+
"composer.json",
9+
"readme.md",
10+
"LICENSE"
11+
]
512
}

0 commit comments

Comments
 (0)