From cdd3d8522765e5114c5e9061cb309074db733135 Mon Sep 17 00:00:00 2001 From: Priyash Patil <38959321+priyashpatil@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:14:35 +0530 Subject: [PATCH 1/3] chore: update roadmap --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c840f97..2d10d79 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,14 @@ curl -fsSL https://raw.githubusercontent.com/priyashpatil/phpup/main/install/mac ## Roadmap +- [x] Simple cross platform automated build - [ ] Easy to install cross platform script - [ ] Base php install - [ ] Built in Composer - [ ] Multiple PHP installs - [ ] Switching PHP versions - [ ] Opt in Xdebug install - - [ ] Doctor -- [ ] Update - [ ] Extensions - [ ] Docker Images From 8dcde9c65bdea87da6c6c97c50da124b326ca77c Mon Sep 17 00:00:00 2001 From: Priyash Patil <38959321+priyashpatil@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:16:43 +0530 Subject: [PATCH 2/3] feat: add linux install --- install/{mac.sh => unix.sh} | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) rename install/{mac.sh => unix.sh} (58%) diff --git a/install/mac.sh b/install/unix.sh similarity index 58% rename from install/mac.sh rename to install/unix.sh index cd92ba8..313c9e7 100755 --- a/install/mac.sh +++ b/install/unix.sh @@ -7,14 +7,30 @@ REPO_OWNER="priyashpatil" REPO_NAME="phpup" ASSET_NAME="phpup" -# Determine system architecture +# Determine system architecture and OS ARCH=$(uname -m) -if [ "$ARCH" = "x86_64" ]; then - ASSET_NAME="${ASSET_NAME}-darwin-amd64" -elif [ "$ARCH" = "arm64" ]; then - ASSET_NAME="${ASSET_NAME}-darwin-arm64" +OS=$(uname -s | tr '[:upper:]' '[:lower:]') + +if [ "$OS" = "darwin" ]; then + if [ "$ARCH" = "x86_64" ]; then + ASSET_NAME="${ASSET_NAME}-darwin-amd64" + elif [ "$ARCH" = "arm64" ]; then + ASSET_NAME="${ASSET_NAME}-darwin-arm64" + else + echo "Unsupported architecture for macOS: $ARCH" + exit 1 + fi +elif [ "$OS" = "linux" ]; then + if [ "$ARCH" = "x86_64" ]; then + ASSET_NAME="${ASSET_NAME}-linux-amd64" + elif [ "$ARCH" = "aarch64" ]; then + ASSET_NAME="${ASSET_NAME}-linux-arm64" + else + echo "Unsupported architecture for Linux: $ARCH" + exit 1 + fi else - echo "Unsupported architecture: $ARCH" + echo "Unsupported operating system: $OS" exit 1 fi From c68cb5b7a86c86cca7e9f4343afb870eabf5f4b5 Mon Sep 17 00:00:00 2001 From: Priyash Patil <38959321+priyashpatil@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:19:21 +0530 Subject: [PATCH 3/3] ci: add run-test.yml --- .github/workflows/release.yml | 2 -- .github/workflows/run-tests.yml | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cff28c0..f9279ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,8 +11,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Setup Go uses: actions/setup-go@v5 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..a64f35f --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,24 @@ +name: Release + +on: + pull_request: + branches: + - main + +jobs: + release: + 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 ./...