Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
09d2647
chore(deps): add Composer lock file
ryangjchandler Feb 12, 2024
393f615
chore: remove Inspire command and refresh build
ryangjchandler Feb 12, 2024
c84d9b3
chore: merge upstream application updates
ngunyimacharia Jul 27, 2026
064bdbc
chore(deps): upgrade Laravel Zero and PHP stack
ngunyimacharia Jul 27, 2026
b392375
feat: migrate commands to Forge API v2
ngunyimacharia Jul 27, 2026
7c46dad
chore(ci): automate tests and binary releases
ngunyimacharia Jul 27, 2026
848fd88
fix(ci): stamp release version into config/app.php before PHAR build
ngunyimacharia Jul 28, 2026
a891805
fix(ci): add iconv extension to the static binary build
ngunyimacharia Jul 28, 2026
01b8e12
fix: send required www_redirect_type on createSite; surface 422 valid…
ngunyimacharia Jul 28, 2026
5b83fd0
fix: send required letsencrypt.key_type; make bailValidation handle n…
ngunyimacharia Jul 28, 2026
7ef0055
fix(destroy): tolerate 404 when listing optional resources (e.g. no m…
ngunyimacharia Jul 28, 2026
b2d7259
feat(deploy): make createSite idempotent on 'domain already added'; t…
ngunyimacharia Jul 28, 2026
f73bd31
fix(deploy): retry env update while a freshly-created site is still p…
ngunyimacharia Jul 28, 2026
d3f8a20
fix(deploy): defer push-to-deploy until after the first deployment
ngunyimacharia Jul 28, 2026
8beaa18
fix(deploy): don't install composer deps at site creation (redundant …
ngunyimacharia Jul 28, 2026
3d24b94
fix(deploy): wait for site install to finish before deploying
ngunyimacharia Jul 28, 2026
df161d1
refactor(commands): extract shared site and domain lookup helpers int…
ngunyimacharia Jul 29, 2026
82f2b07
fix(deploy): surface real failures instead of proceeding silently
ngunyimacharia Jul 29, 2026
e3b91be
fix(deploy): stop requiring route-53 credentials for wildcard sites
ngunyimacharia Jul 29, 2026
ed5f977
fix(deploy): harden provisioning failure handling
ngunyimacharia Jul 30, 2026
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
176 changes: 176 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
name: release

on:
push:
tags:
- 'v*'

permissions:
contents: write

env:
# Extensions justified against the dependency require blocks:
# - zlib is MANDATORY because box.json uses GZ phar compression.
# - iconv is required by symfony/polyfill-mbstring (Box's requirements
# checker rejects the binary without it).
SPC_EXTENSIONS: bcmath,ctype,curl,dom,fileinfo,filter,hash,iconv,libxml,mbstring,openssl,pcntl,phar,posix,session,simplexml,sockets,tokenizer,xml,xmlreader,xmlwriter,zlib
PHP_VERSION: '8.5'

jobs:
# 1. Compile the PHAR with Box. This is a build-time intermediate only — it is
# consumed by micro:combine below and is NOT published as a release asset.
build-phar:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: bcmath, ctype, curl, dom, fileinfo, filter, hash, iconv, libxml, mbstring, openssl, pcntl, phar, posix, session, simplexml, sockets, tokenizer, xml, xmlreader, xmlwriter, zlib
ini-values: phar.readonly=0
coverage: none

- name: Install dependencies (production)
run: composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader

- name: Stamp release version
# config/app.php resolves the version via app('git.version'), which shells
# out to `git describe` at boot. Inside a PHAR the working directory is a
# phar:// path, so proc_open() fails and the packaged artifact cannot boot.
# Bake the tag in as a literal so the binary never shells out to git.
run: |
sed -i "s|app('git.version')|'${GITHUB_REF_NAME}'|" config/app.php
grep "'version'" config/app.php

- name: Install Box
run: |
composer global require humbug/box:^4.6 --no-interaction
echo "$(composer global config home -q)/vendor/bin" >> "$GITHUB_PATH"

- name: Compile PHAR
run: |
box compile --no-interaction
# box.json sets no explicit output; Box derives it from the composer.json
# "bin" (forge-previewer) -> forge-previewer.phar. Normalise defensively.
PHAR="$(ls -1 *.phar | head -n1)"
if [ "$PHAR" != "forge-previewer.phar" ]; then mv "$PHAR" forge-previewer.phar; fi
php forge-previewer.phar --version

- name: Upload PHAR artifact
uses: actions/upload-artifact@v4
with:
name: forge-previewer-phar
path: forge-previewer.phar
retention-days: 1

# 2. Build a fully-static (musl) micro.sfx with the embedded PHP and combine it
# with the PHAR. The musl static binary has zero libc dependency, so one
# x86_64 binary runs on Ubuntu 20.04, 24.04, and everything else.
build-static-binary:
runs-on: ubuntu-24.04
needs: build-phar
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download PHAR artifact
uses: actions/download-artifact@v4
with:
name: forge-previewer-phar

- name: Setup PHP (spc tooling host)
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none

- name: Checkout static-php-cli (pinned)
uses: actions/checkout@v4
with:
# Pin to a tagged release. Never main — the v3 rebrand is unreleased.
repository: crazywhalecc/static-php-cli
ref: '2.8.5'
path: static-php-cli

- name: Install spc dependencies
working-directory: static-php-cli
run: composer install --no-dev --no-interaction --prefer-dist

- name: Cache spc downloads and build root
uses: actions/cache@v4
with:
path: |
static-php-cli/downloads
static-php-cli/buildroot
key: spc-${{ runner.os }}-php${{ env.PHP_VERSION }}-${{ hashFiles('.github/workflows/release.yml') }}

- name: spc doctor
working-directory: static-php-cli
run: ./bin/spc doctor --auto-fix

- name: Download sources
working-directory: static-php-cli
run: ./bin/spc download --for-extensions="${{ env.SPC_EXTENSIONS }}" --with-php=${{ env.PHP_VERSION }}

- name: Build micro.sfx
working-directory: static-php-cli
run: ./bin/spc build "${{ env.SPC_EXTENSIONS }}" --build-micro

- name: Combine micro.sfx + PHAR
working-directory: static-php-cli
run: ./bin/spc micro:combine ../forge-previewer.phar --output=../forge-previewer-linux-x86_64

- name: Smoke test (native, ubuntu-24.04)
run: |
chmod +x forge-previewer-linux-x86_64
./forge-previewer-linux-x86_64 --version
./forge-previewer-linux-x86_64 list
./forge-previewer-linux-x86_64 deploy --help

- name: Smoke test (ubuntu:20.04 container — proves 20.04 compat)
run: |
docker run --rm -v "$PWD":/work -w /work ubuntu:20.04 ./forge-previewer-linux-x86_64 --version
docker run --rm -v "$PWD":/work -w /work ubuntu:20.04 ./forge-previewer-linux-x86_64 list

- name: Prepare release assets
run: |
# Byte-identical copies so the release page explicitly shows both
# supported targets. The static binary is the same everywhere.
cp forge-previewer-linux-x86_64 forge-previewer-ubuntu-24.04
cp forge-previewer-linux-x86_64 forge-previewer-ubuntu-20.04
sha256sum forge-previewer-linux-x86_64 forge-previewer-ubuntu-24.04 forge-previewer-ubuntu-20.04 > SHA256SUMS.txt
cat SHA256SUMS.txt

- name: Upload release binaries
uses: actions/upload-artifact@v4
with:
name: release-binaries
path: |
forge-previewer-linux-x86_64
forge-previewer-ubuntu-24.04
forge-previewer-ubuntu-20.04
SHA256SUMS.txt
retention-days: 1

# 3. Attach the binaries (and checksums) to the GitHub Release for the tag.
release:
runs-on: ubuntu-24.04
needs: build-static-binary
steps:
- name: Download release binaries
uses: actions/download-artifact@v4
with:
name: release-binaries

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
forge-previewer-linux-x86_64
forge-previewer-ubuntu-24.04
forge-previewer-ubuntu-20.04
SHA256SUMS.txt
generate_release_notes: true
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: tests

on:
push:
branches:
- main
pull_request:

jobs:
tests:
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
# PHP 8.5 is the current stable and our source/build floor.
# Extend this matrix when 8.6 lands.
php: ['8.5']
name: PHP ${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: bcmath, ctype, curl, dom, fileinfo, filter, hash, iconv, libxml, mbstring, openssl, pcntl, phar, posix, session, simplexml, sockets, tokenizer, xml, xmlreader, xmlwriter, zlib
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@v3

- name: Run tests
run: vendor/bin/pest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/vendor
/builds
/.idea
/.vscode
/.vagrant
.phpunit.result.cache
.env
composer.lock
Loading
Loading