Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs #7

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
b81cd49
wip
priyashpatil Aug 17, 2024
29e7ebe
feat: add cobra + viper cli app
priyashpatil Oct 17, 2024
bcf0620
docs: add build docs
priyashpatil Oct 17, 2024
ccef1eb
feat: remove box build
priyashpatil Oct 17, 2024
4a0c7ba
chore: remove old README
priyashpatil Oct 17, 2024
55d235a
chore: remove src
priyashpatil Oct 17, 2024
432fc36
test: add simple cli test
priyashpatil Oct 17, 2024
8bbb042
test: add tests folder
priyashpatil Oct 17, 2024
59a3bb9
docs: add testing docs
priyashpatil Oct 17, 2024
eb8b066
chore: add roadmap
priyashpatil Oct 17, 2024
28bfa55
chore: update .gitignore
priyashpatil Oct 17, 2024
4351afc
chore: add contributing docs
priyashpatil Oct 17, 2024
213417c
test: command output
priyashpatil Oct 17, 2024
05bb05e
ci: add multi platform build
priyashpatil Oct 17, 2024
081415e
Merge pull request #1 from priyashpatil/priyash
priyashpatil Oct 17, 2024
bb0cbea
docs: update README
priyashpatil Oct 17, 2024
bd943c9
ci: fix node version
priyashpatil Oct 17, 2024
67467a7
chore(release): 1.0.0 [skip ci]
semantic-release-bot Oct 17, 2024
b592727
ci: remove testing in release
priyashpatil Oct 17, 2024
ceca740
chore: add changelog
priyashpatil Oct 17, 2024
6e695b4
Merge pull request #2 from priyashpatil/ci-release
priyashpatil Oct 17, 2024
6594385
chore: fix typo
priyashpatil Oct 17, 2024
1583d95
feat: add mac install script
priyashpatil Oct 17, 2024
1b4e631
Merge pull request #3 from priyashpatil/download-cli
priyashpatil Oct 17, 2024
ce753b7
chore(release): 0.1.0 [skip ci]
semantic-release-bot Oct 17, 2024
9701fb0
fix: ci build id reference
priyashpatil Oct 17, 2024
27db3b9
Merge pull request #4 from priyashpatil/fix/ci-build
priyashpatil Oct 17, 2024
a67cd12
chore(release): 0.1.1 [skip ci]
semantic-release-bot Oct 17, 2024
00dc40a
fix: build artifact
priyashpatil Oct 17, 2024
e2d9bd4
fix(ci): build
priyashpatil Oct 17, 2024
9649378
Merge pull request #5 from priyashpatil/fix/ci-build
priyashpatil Oct 17, 2024
8007ddf
chore(release): 0.1.2 [skip ci]
semantic-release-bot Oct 17, 2024
70a44ec
fix: mac install script
priyashpatil Oct 17, 2024
929a6e5
docs: add installation docs
priyashpatil Oct 17, 2024
6e23711
Merge pull request #6 from priyashpatil/fix/mac-install-script
priyashpatil Oct 17, 2024
93c11e4
chore(release): 0.1.3 [skip ci]
semantic-release-bot Oct 17, 2024
cdd3d85
chore: update roadmap
priyashpatil Oct 17, 2024
8dcde9c
feat: add linux install
priyashpatil Oct 17, 2024
c68cb5b
ci: add run-test.yml
priyashpatil Oct 17, 2024
558b59c
Merge pull request #7 from priyashpatil/unix-install
priyashpatil Oct 17, 2024
29b8a44
chore(release): 0.2.0 [skip ci]
semantic-release-bot Oct 17, 2024
57bca88
ci: change job names
priyashpatil Oct 17, 2024
ec141ca
Merge pull request #8 from priyashpatil/unix-install
priyashpatil Oct 17, 2024
e356f8d
docs: add linux install docs
priyashpatil Oct 17, 2024
d7f2669
feat: add windows install script
priyashpatil Oct 17, 2024
1c170d1
docs: add windows install docs
priyashpatil Oct 17, 2024
42336d5
Merge pull request #9 from priyashpatil/windows-install-docs
priyashpatil Oct 17, 2024
ec9fa7c
chore(release): 0.3.0 [skip ci]
semantic-release-bot Oct 17, 2024
7a9e37f
docs: fix typo
priyashpatil Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 34 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
name: Release

on: push
on:
push:
branches:
- main

jobs:
build:
runs-on: macos-latest
publish-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2

- name: Setup Go
uses: actions/setup-go@v5
with:
php-version: 8.3
tools: composer:v2, box

- name: Install PHP deps
uses: ramsey/composer-install@v3

- name: Build
run: make build

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
go-version: "1.23"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
files: |
build/phpup
node-version: "20"

- name: Install dependencies
run: go mod download

- name: Build for multiple platforms
run: |
GOOS=linux GOARCH=amd64 go build -o build/phpup-linux-amd64
GOOS=linux GOARCH=arm64 go build -o build/phpup-linux-arm64
GOOS=darwin GOARCH=amd64 go build -o build/phpup-darwin-amd64
GOOS=darwin GOARCH=arm64 go build -o build/phpup-darwin-arm64
GOOS=windows GOARCH=amd64 go build -o build/phpup-windows-amd64.exe

- name: Install semantic-release
run: |
npm install -g semantic-release @semantic-release/github @semantic-release/git @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/release-notes-generator

- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
24 changes: 24 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
pull_request:
branches:
- main

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.23"

- name: Install dependencies
run: go mod download

- name: Run tests
run: go test ./...
30 changes: 24 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/vendor/
/build/
/.box_dump/
/tmp/
/composer.lock
/patches.lock.json
.DS_Store

# Binaries for programs and plugins
phpup
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

# Build artifacts
build/
phpup-*
35 changes: 35 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/github",
{
"assets": [
{
"path": "build/phpup-linux-amd64",
"label": "Linux AMD64"
},
{
"path": "build/phpup-linux-arm64",
"label": "Linux ARM64"
},
{
"path": "build/phpup-darwin-amd64",
"label": "macOS AMD64"
},
{
"path": "build/phpup-darwin-arm64",
"label": "macOS ARM64"
},
{
"path": "build/phpup-windows-amd64.exe",
"label": "Windows AMD64"
}
]
}
],
"@semantic-release/git"
]
}
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# [0.3.0](https://github.com/priyashpatil/phpup/compare/v0.2.0...v0.3.0) (2024-10-17)


### Features

* add windows install script ([d7f2669](https://github.com/priyashpatil/phpup/commit/d7f2669b82bee9bf0dab4656fdd58371386eeba2))

# [0.2.0](https://github.com/priyashpatil/phpup/compare/v0.1.3...v0.2.0) (2024-10-17)


### Features

* add linux install ([8dcde9c](https://github.com/priyashpatil/phpup/commit/8dcde9c65bdea87da6c6c97c50da124b326ca77c))

## [0.1.3](https://github.com/priyashpatil/phpup/compare/v0.1.2...v0.1.3) (2024-10-17)


### Bug Fixes

* mac install script ([70a44ec](https://github.com/priyashpatil/phpup/commit/70a44ec72d016fd08e52bb3f40495b4fe1baa1cf))

## [0.1.2](https://github.com/priyashpatil/phpup/compare/v0.1.1...v0.1.2) (2024-10-17)


### Bug Fixes

* build artifact ([00dc40a](https://github.com/priyashpatil/phpup/commit/00dc40aff0421d4861c10f55b07e6864d191b4a5))
* **ci:** build ([e2d9bd4](https://github.com/priyashpatil/phpup/commit/e2d9bd45310fdf4bae7a64560a64177e0869b23f))

## [0.1.1](https://github.com/priyashpatil/phpup/compare/v0.1.0...v0.1.1) (2024-10-17)


### Bug Fixes

* ci build id reference ([9701fb0](https://github.com/priyashpatil/phpup/commit/9701fb0fa6f6d063f5660cd2bb241bb64005106b))

# [0.1.0](https://github.com/priyashpatil/phpup/compare/v0.0.1...v0.1.0) (2024-10-17)


### Features

* add mac install script ([1583d95](https://github.com/priyashpatil/phpup/commit/1583d9526185d7deeca5481e8b56a309b156e75a))

# 0.0.1 (2024-10-17)
4 changes: 0 additions & 4 deletions Makefile

This file was deleted.

103 changes: 41 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,63 @@
<h1 align="center">
<code lang="html">phpup</code><br>The PHP Toolchain
</h1>
# phpup

_Phpup_ is a single-file binary with _**zero dependencies**_ that includes Composer and other PHP tools. It also allows installing a per-project PHP based on your `composer.json`.

You don't need to have PHP or anything at all on your system to run it.

> [!WARNING]
> **Under heavy development**
> Currently, this is an MVP, and only macOS aarch64 is supported.
phpup - CLI tool for managing PHP environments.

## Installation

Download `phpup` binary from the release page and put it into a directory on your PATH, so you can simply call `phpup` from any directory.
### macOS and Linux

```bash
curl -OL https://github.com/pronskiy/phpup/releases/latest/download/phpup
chmod +x phpup
sudo mv phpup /usr/local/bin/phpup
To install on macOS or Linux, run the following command in your terminal:

```sh
curl -fsSL https://raw.githubusercontent.com/priyashpatil/phpup/main/install/unix.sh | bash
```

## Usage
### Windows

- `phpup list` – See the list of available commands.
- `phpup <file>` – Run any php file. 🚧
- `phpup composer` – Composer that does not require PHP to be installed.
- `phpup conductor <command>` – Like npx but for PHP. 🚧
- `phpup locus` – Installs PHP binary under your project's `vendor/bin/php` based on the requirements in _composer.json_.
For Windows 64-bit, follow these steps:

- ~~`phpup phpstan` – PHPStan that does not require PHP. 🚧~~
- ~~`phpup rector` – Rector that does not require PHP. 🚧~~
1. Open PowerShell as Administrator
2. Run the following command:

## Contributing
```powershell
iwr -useb https://raw.githubusercontent.com/priyashpatil/phpup/main/install/windows.ps1 | iex
```

Contributions are very welcome! However, it's recommended to first create an issue describing the idea — let's find the best approach together.
## Roadmap

See some ideas in the todo list below.
- [x] Simple cross platform automated build
- [x] Easy to install cross platform script
- [ ] Base php install
- [ ] Built in Composer
- [ ] Multiple PHP installs
- [ ] Switching PHP versions
- [ ] Opt in Xdebug install
- [ ] Per project PHP installation
- [ ] Doctor
- [ ] Extensions
- [ ] Docker Images

### Build Requirements
## Contributing

Before you begin, ensure you have met the following requirements:
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

- [Make](https://www.gnu.org/software/make/) (version 3.0 or later)
- [Box](https://github.com/box-project/box) (version 4.x)
Commit message standards are based on [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

Building Binary
### Build

```shell
make build
```sh
go build
```

### TODO

- [x] Run php script [https://github.com/pronskiy/phpup/issues/1](https://github.com/pronskiy/phpup/issues/1)
### Testing

- [ ] Accept a reference to a packagist/gh repo, to be able to run its scripts/bin/
- [https://twitter.com/AdrienBrault/status/1782476060426179049](https://twitter.com/AdrienBrault/status/1782476060426179049)
- [https://twitter.com/pronskiy/status/1768219585151402251](https://twitter.com/pronskiy/status/1768219585151402251)
- [https://github.com/artisan-build/conductor](https://github.com/artisan-build/conductor)
- [https://github.com/pronskiy/conductor](https://github.com/pronskiy/conductor)
- [https://github.com/artisan-build/conductor/issues/8](https://github.com/artisan-build/conductor/issues/8)

- [ ] Support Windows
- [ ] Support Linux

- [ ] Make symfony/console app
- [ ] Add help command

- [ ] Extract packing with box and micro php to a stand-alone GitHub action
- [ ] Reduce size of the resulting binary
- [ ] Check microphp's [patches](https://github.com/easysoft/phpmicro/blob/master/patches/Readme.md):
- [ ] Bypass cli SAPI name checks
- [ ] static_opcache

- ~~[ ] Add more tools~~
- ~~[ ] PHP-CS-Fixer~~
- ~~[ ] PHPUnit~~
- ~~[ ] Support Rector 🚧~~
- ~~[ ] Support PHPStan 🚧~~
```sh
go test ./tests
```

## Credits
Step Debugging with VSCode:

This package entirely relies on [https://github.com/static-php](https://github.com/static-php) and [https://github.com/easysoft/phpmicro](https://github.com/easysoft/phpmicro).
```sh
go install github.com/go-delve/delve/cmd/dlv@latest
```
11 changes: 0 additions & 11 deletions box.json

This file was deleted.

40 changes: 0 additions & 40 deletions build.sh

This file was deleted.

Loading