Skip to content

Commit 04ff2ff

Browse files
committed
Enable distribution via PHAR
1 parent acda628 commit 04ff2ff

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
.php-cs-fixer.php export-ignore
1010
bin/application-version export-ignore
1111
bin/release-version export-ignore
12+
box.json.dist export-ignore
1213
CHANGELOG.md export-ignore
1314
CONDUCT.md export-ignore
1415
CONTRIBUTING.md export-ignore

.github/workflows/distribute.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: distribute
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
tests:
10+
name: distribute
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
php:
17+
- "8.1"
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: "${{ matrix.php }}"
27+
28+
- name: Install Composer dependencies
29+
run: composer install --no-progress --prefer-dist --optimize-autoloader
30+
31+
- name: Install Box Phar bundler
32+
run: wget --quiet https://github.com/box-project/box/releases/download/4.5.1/box.phar && sudo mv box.phar /usr/bin/box && sudo chmod u+x /usr/bin/box
33+
shell: bash
34+
35+
- name: Build PHAR
36+
run: /usr/bin/box compile
37+
38+
- name: Check generated PHAR
39+
run: bin/git-user-bend.phar --version
40+
41+
- name: Create Release
42+
uses: softprops/action-gh-release@v1
43+
if: startsWith(github.ref, 'refs/tags/')
44+
with:
45+
files: bin/git-user-bend.phar

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ Since the default name of the CLI is quite a mouthful, an alias which can be pla
2525
alias gub='~/.config/composer/vendor/bin/git-user-bend $@'
2626
```
2727

28+
> [!TIP]
29+
> As of release `v1.2.1` it's also possible to install and use `git-user-bend` via a PHAR [file](https://github.com/raphaelstolt/git-user-bend/releases/tag/v1.2.1).
30+
2831
## Usage
2932
Run the `git-user-bend whoami` CLI within a Git repository (or an argumented one) and it will allow you to view the currently used persona respectively the Git user configuration details.
3033

box.json.dist

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "res/schema.json",
3+
"directories": ["src", "vendor/symfony/console/Resources"],
4+
"force-autodiscovery": true,
5+
"finder": [
6+
{
7+
"name": "*.php",
8+
"exclude": ["tests", ".github", "example", ".*"],
9+
"in": "vendor"
10+
}
11+
]
12+
}

0 commit comments

Comments
 (0)