-
-
Notifications
You must be signed in to change notification settings - Fork 1
Release Workflow
Saiful Alam Rakib edited this page Apr 22, 2026
·
1 revision
Bill Organizer uses a GitHub Actions CI/CD pipeline to automatically build, package, and publish production-ready releases.
File: .github/workflows/release.yml
The workflow:
- Installs all dependencies
- Type-checks TypeScript
- Compiles frontend assets with Vite
- Packages a clean ZIP (dev files excluded)
- Auto-increments the patch version
- Creates a draft GitHub Release with the ZIP attached
Every merge or push to main triggers a new release build:
git push origin main- Go to your repository's Actions tab
- Select the Release workflow
- Click Run workflow
- Choose the branch (typically
main) - Click Run workflow
| Step | Description |
|---|---|
| Checkout | Full git history for version tag detection |
| Setup PHP 8.3 | Installs PHP with all required extensions |
| Setup Node.js 22 | Configures Node with Yarn cache |
| Composer cache | Caches vendor directory for faster builds |
| Install Composer deps | Production-only dependencies |
| Install Yarn deps | yarn install --frozen-lockfile |
| Generate app key | php artisan key:generate |
| Ziggy routes | php artisan ziggy:generate |
| TypeScript check | Validates all TypeScript types |
| Vite build | Compiles and bundles frontend assets |
| Package artifacts |
rsync copy excluding dev files |
| Create ZIP |
zip -r production archive |
| Generate version | Auto-increments patch from latest git tag |
| Create draft release | Publishes draft with ZIP attachment |
| Upload artifact | Stores ZIP for 30 days (GitHub Actions artifacts) |
The workflow automatically determines the next version from the latest git tag:
- If tags exist and follow semver (
v1.2.3) → increments patch →v1.2.4 - If no tags exist → starts at
v0.0.1
Releases are created as drafts so you can review before publishing.
Minor version increment:
NEW_MINOR=$((MINOR + 1))
NEW_VERSION="v${MAJOR}.${NEW_MINOR}.0"Major version increment:
NEW_MAJOR=$((MAJOR + 1))
NEW_VERSION="v${NEW_MAJOR}.0.0"Pre-release (beta/RC):
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
NEW_VERSION="${NEW_VERSION}-beta.${GITHUB_RUN_NUMBER}"
fiThe production ZIP includes only files needed at runtime:
bill-organizer-vX.X.X.zip
├── app/
├── bootstrap/
├── config/
├── database/
├── public/
│ └── build/ ← compiled Vite assets
├── resources/
│ └── views/
├── routes/
├── storage/
├── vendor/ ← production Composer dependencies
├── .env.example
├── artisan
└── composer.json
Excluded from the ZIP:
tests/node_modules/.github/- Dev config files (
.eslintrc,vite.config.ts, etc.) -
resources/js/source files -
.env(never committed or packaged)
- Download the ZIP from GitHub Releases
- Extract to your web server directory
- Set up
.env:cp .env.example .env php artisan key:generate
- Configure database and run migrations:
php artisan migrate --force
- Set file permissions:
chmod -R 755 storage bootstrap/cache chown -R www-data:www-data storage bootstrap/cache
- Point web server to
public/
See Deployment for a full guide.
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4' # ← update here
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # ← update hereModify the rsync command in the workflow:
rsync -av \
--exclude='custom-config/' \
--exclude='*.custom' \
# ... existing excludes ...Change the release step flag:
- name: Create Release
uses: softprops/action-gh-release@v1
with:
draft: false # ← change to false to publish immediately- Uses
GITHUB_TOKENwith minimal required permissions -
.envis never included in build artifacts - Development files (tests, configs) are excluded from releases
- Build artifacts are retained for 30 days only
| Problem | Solution |
|---|---|
| Composer dependency error | Ensure all deps are compatible with PHP 8.3 |
| Yarn lockfile mismatch | Commit the updated yarn.lock
|
| TypeScript type errors | Fix type errors locally before pushing |
| Vite build failure | Check vite.config.ts and asset imports |
| Wrong version generated | Verify git tags follow v1.2.3 semver format |
| Tag conflict | Check if the generated tag already exists and delete it |
| ZIP upload failure | Verify the ZIP was created in the packaging step logs |
| Missing GitHub Actions permissions | Enable write permissions in repo settings → Actions |
© Bill Organizer - Free for Personal use | Need paid license for Commercial use