Skip to content

Commit a691c63

Browse files
authored
Create build-pkg-unix.yml
1 parent 8dd8d39 commit a691c63

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: "Build Packages (Unix)"
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 1 */3 * *"
7+
8+
jobs:
9+
build-packages:
10+
name: "Build package ${{ matrix.pkg }}-${{ matrix.os.name }}"
11+
runs-on: ${{ matrix.os.runner }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
pkg: ["pkg-config"]
16+
os:
17+
- name: "macos-aarch64"
18+
runner: "macos-15"
19+
- name: "macos-x86_64"
20+
runner: "macos-13"
21+
- name: "linux-x86_64"
22+
runner: "ubuntu-latest"
23+
- name: "linux-aarch64"
24+
runner: "ubuntu-24.04-arm"
25+
steps:
26+
- name: "Checkout remote"
27+
uses: actions/checkout@v4
28+
with:
29+
repository: crazywhalecc/static-php-cli
30+
ref: main
31+
32+
- name: "Setup Runtime for static-php-cli"
33+
id: setup-runtime
34+
run: |
35+
case "${{ matrix.os.name }}" in
36+
linux-*)
37+
bin/spc-alpine-docker --help
38+
echo "SPC_PREFIX=bin/spc-alpine-docker" >> "$GITHUB_OUTPUT"
39+
;;
40+
macos-*)
41+
bin/setup-runtime
42+
export PATH="$(pwd)/bin:$PATH"
43+
bin/spc doctor --auto-fix
44+
echo "SPC_PREFIX=bin/spc" >> "$GITHUB_OUTPUT"
45+
;;
46+
esac
47+
48+
- name: "Build package ${{ matrix.pkg }}"
49+
run: ${{ steps.setup-runtime.outputs.SPC_PREFIX }} build:libs ${{ matrix.pkg }} --debug
50+
51+
- name: "Pack package ${{ matrix.pkg }}"
52+
run: |
53+
mkdir -p dist
54+
tar -czf dist/${{ matrix.pkg }}-${{ matrix.os.name }}.tar.gz -C buildroot .
55+
56+
- name: "Deploy to self-hosted OSS"
57+
uses: static-php/[email protected]
58+
with:
59+
aws_key_id: ${{ secrets.AWS_KEY_ID }}
60+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
61+
aws_bucket: ${{ secrets.AWS_BUCKET }}
62+
source_dir: "dist/"
63+
destination_dir: packages/${{ matrix.pkg }}/
64+
endpoint: ${{ secrets.AWS_ENDPOINT }}
65+
66+
- name: "Upload Artifact"
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: ${{ matrix.pkg }}-${{ matrix.os.name }}
70+
path: |
71+
buildroot/
72+
if-no-files-found: error

0 commit comments

Comments
 (0)