Skip to content

Build Package Distributable (Unix) #8

Build Package Distributable (Unix)

Build Package Distributable (Unix) #8

name: "Build Package Distributable (Unix)"
on:
workflow_dispatch:
schedule:
- cron: "0 1 */3 * *"
jobs:
build-packages:
name: "Build package distributable ${{ matrix.pkg }}-${{ matrix.os.name }}"
runs-on: ${{ matrix.os.runner }}
strategy:
fail-fast: false
matrix:
pkg: ["pkg-config"]
os:
- name: "aarch64-darwin"
runner: "macos-15"
- name: "x86_64-darwin"
runner: "macos-13"
- name: "x86_64-linux"
runner: "ubuntu-latest"
- name: "aarch64-linux"
runner: "ubuntu-24.04-arm"
steps:
- name: "Checkout remote"
uses: actions/checkout@v4
with:
repository: crazywhalecc/static-php-cli
ref: main
- name: "Setup Runtime for static-php-cli"
id: setup-runtime
run: |
case "${{ matrix.os.name }}" in
*-linux)
bin/spc-alpine-docker --help
echo "SPC_PREFIX=bin/spc-alpine-docker" >> "$GITHUB_OUTPUT"
;;
*-darwin)
bin/setup-runtime
export PATH="$(pwd)/bin:$PATH"
echo "$(pwd)/bin" >> $GITHUB_PATH
composer install --no-dev
bin/spc doctor --auto-fix
echo "SPC_PREFIX=bin/spc" >> "$GITHUB_OUTPUT"
;;
esac
- name: "Download package ${{ matrix.pkg }}"
run: ${{ steps.setup-runtime.outputs.SPC_PREFIX }} download --for-libs=${{ matrix.pkg }} --ignore-cache-sources
- name: "Build package ${{ matrix.pkg }}"
run: ${{ steps.setup-runtime.outputs.SPC_PREFIX }} dev:pack-lib ${{ matrix.pkg }} --debug
- name: "Deploy to self-hosted OSS"
uses: static-php/[email protected]
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: "dist/"
destination_dir: packages/${{ matrix.pkg }}/
endpoint: ${{ secrets.AWS_ENDPOINT }}
- name: "Upload Artifact"
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.pkg }}-${{ matrix.os.name }}
path: |
buildroot/
if-no-files-found: error