updated docker-compose to use latest images, patched osx binary build script, experimenting with artifact upload for binaries

This commit is contained in:
Ronald A. Richardson
2025-05-21 22:18:49 +08:00
parent fcb3694874
commit 92170c965e
3 changed files with 32 additions and 62 deletions

View File

@@ -1,10 +1,9 @@
name: Build Binaries name: Build & Publish Binaries
on: on:
pull_request: pull_request:
push: release:
tags: types: [published]
- 'v*'
env: env:
DIST_DIR: builds/dist DIST_DIR: builds/dist
@@ -15,51 +14,29 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - uses: actions/checkout@v3
uses: actions/checkout@v3
# - name: Run Linux build - name: Build Linux binary
# run: | run: |
# chmod +x ./builds/linux/build-linux.sh chmod +x ./builds/linux/build-linux.sh
# ./builds/linux/build-linux.sh ./builds/linux/build-linux.sh
# - name: Upload for PR testing - name: Upload Linux binary
# if: ${{ github.event_name == 'pull_request' }} if: github.event_name == 'release'
# uses: actions/upload-artifact@v4 uses: softprops/action-gh-release@v2
# with: with:
# name: fleetbase-api-linux-binary files: |
# path: ${{ env.DIST_DIR }}/fleetbase-linux-x86_64 ${{ env.DIST_DIR }}/fleetbase-linux-x86_64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Create GitHub Release build-macos:
# if: ${{ github.event_name == 'push' }}
# id: create_release
# uses: actions/create-release@v1
# with:
# tag_name: ${{ github.ref_name }}
# release_name: Release ${{ github.ref_name }}
# body: |
# • Built on ${{ github.run_started_at }}
# • Linux and macOS static binaries
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Upload Linux to Release
# if: ${{ github.event_name == 'push' }}
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ${{ env.DIST_DIR }}/fleetbase-linux-x86_64
# asset_name: fleetbase-linux-x86_64
# asset_content_type: application/octet-stream
build-osx:
name: macOS (ARM64) Build name: macOS (ARM64) Build
needs: build-linux needs: build-linux
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: Checkout - uses: actions/checkout@v3
uses: actions/checkout@v3
- name: Install build dependencies - name: Install build dependencies
run: | run: |
@@ -68,23 +45,16 @@ jobs:
source "$(brew --prefix asdf)/libexec/asdf.sh" source "$(brew --prefix asdf)/libexec/asdf.sh"
asdf plugin add php https://github.com/asdf-community/asdf-php.git asdf plugin add php https://github.com/asdf-community/asdf-php.git
- name: Run macOS build - name: Build macOS binary
run: | run: |
chmod +x ./builds/osx/build-osx.sh chmod +x ./builds/osx/build-osx.sh
./builds/osx/build-osx.sh ./builds/osx/build-osx.sh
- name: Upload for PR testing - name: Upload macOS binary
if: ${{ github.event_name == 'pull_request' }} if: github.event_name == 'release'
uses: actions/upload-artifact@v4 uses: softprops/action-gh-release@v2
with: with:
name: fleetbase-api-macos-binary files: |
path: ${{ env.DIST_DIR }}/fleetbase-$(uname -s)-$(uname -m) ${{ env.DIST_DIR }}/fleetbase-darwin-arm64
env:
# - name: Upload macOS to Release GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# if: ${{ github.event_name == 'push' }}
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ needs.build-linux.steps.create_release.outputs.upload_url }}
# asset_path: ${{ env.DIST_DIR }}/fleetbase-$(uname -s)-$(uname -m)
# asset_name: fleetbase-macos-arm64
# asset_content_type: application/octet-stream

View File

@@ -46,11 +46,11 @@ fi
# 🔁 Trap to restore PHP when script exits # 🔁 Trap to restore PHP when script exits
trap 'if [ "$IS_ASDF_MANAGED" = true ]; then trap 'if [ "$IS_ASDF_MANAGED" = true ]; then
log "Restoring asdf-managed PHP version: $ORIGINAL_PHP_VERSION" log "Restoring asdf-managed PHP version: $ORIGINAL_PHP_VERSION"
asdf set php "$ORIGINAL_PHP_VERSION" asdf set php "$ORIGINAL_PHP_VERSION" || true
log "Reverted to PHP $(php -v | head -n 1)" log "Reverted to PHP $(php -v | head -n 1)"
else else
log "Unsetting asdf set to restore system PHP" log "Unsetting asdf set to restore system PHP"
asdf set php system asdf set php system || true
log "Reverted to PHP $(php -v | head -n 1)" log "Reverted to PHP $(php -v | head -n 1)"
fi' EXIT fi' EXIT

View File

@@ -32,7 +32,7 @@ services:
SOCKETCLUSTER_BROKERS: 10 SOCKETCLUSTER_BROKERS: 10
scheduler: scheduler:
image: fleetbase/fleetbase-api:v0.7.0 image: fleetbase/fleetbase-api:latest
command: ["go-crond", "--verbose", "root:./crontab"] command: ["go-crond", "--verbose", "root:./crontab"]
environment: environment:
DATABASE_URL: "mysql://root@database/fleetbase" DATABASE_URL: "mysql://root@database/fleetbase"
@@ -43,7 +43,7 @@ services:
REDIS_URL: tcp://cache REDIS_URL: tcp://cache
queue: queue:
image: fleetbase/fleetbase-api:v0.7.0 image: fleetbase/fleetbase-api:latest
command: ["php", "artisan", "queue:work"] command: ["php", "artisan", "queue:work"]
healthcheck: healthcheck:
test: ["CMD", "php", "artisan", "queue:status"] test: ["CMD", "php", "artisan", "queue:status"]
@@ -59,14 +59,14 @@ services:
REDIS_URL: tcp://cache REDIS_URL: tcp://cache
console: console:
image: fleetbase/fleetbase-console:v0.7.0 image: fleetbase/fleetbase-console:latest
ports: ports:
- "4200:4200" - "4200:4200"
volumes: volumes:
- ./console/fleetbase.config.json:/usr/share/nginx/html/fleetbase.config.json - ./console/fleetbase.config.json:/usr/share/nginx/html/fleetbase.config.json
application: application:
image: fleetbase/fleetbase-api:v0.7.0 image: fleetbase/fleetbase-api:latest
environment: environment:
ENVIRONMENT: development ENVIRONMENT: development
DATABASE_URL: "mysql://root@database/fleetbase" DATABASE_URL: "mysql://root@database/fleetbase"