Page MenuHomePhorge

build.yml
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

build.yml

name: Build All Platforms
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
prepare:
runs-on: ubuntu-latest
if: |
github.ref_type != 'tag' &&
!contains(github.event.head_commit.message || '', '(ci-ignore)') &&
!contains(github.event.pull_request.title || '', '(ci-ignore)') && (
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
(github.event_name == 'push' && contains(github.event.head_commit.message, '[ci] trigger build'))
)
outputs:
timestamp: ${{ steps.timestamp.outputs.value }}
steps:
- id: timestamp
run: echo "value=$(date +%s)" >> $GITHUB_OUTPUT
build:
needs: prepare
strategy:
fail-fast: false
matrix:
platform:
- linux-glibc-x64
- linux-glibc-aarch64
- linux-musl-x64
- linux-musl-aarch64
- macos-x64
- macos-aarch64
- windows-x64
uses: ./.github/workflows/build-platform.yml
with:
platform: ${{ matrix.platform }}
build_timestamp: ${{ needs.prepare.outputs.timestamp }}
build-mbedtls:
needs: prepare
strategy:
fail-fast: false
matrix:
platform:
- linux-glibc-x64
- linux-glibc-aarch64
- linux-musl-x64
- linux-musl-aarch64
- macos-x64
- macos-aarch64
- windows-x64
uses: ./.github/workflows/build-platform.yml
with:
platform: ${{ matrix.platform }}
tls_library: mbedtls
build_timestamp: ${{ needs.prepare.outputs.timestamp }}
summary:
name: Build Summary
needs: [build, build-mbedtls]
runs-on: ubuntu-latest
if: ${{ !cancelled() && (needs.build.result != 'skipped' || needs.build-mbedtls.result != 'skipped') }}
steps:
- name: Download version artifacts
uses: actions/download-artifact@v4
with:
pattern: version-*
path: versions
- name: Generate summary
run: |
VERSIONS=()
for dir in versions/version-*; do
v=$(cat "$dir/version.txt" 2>/dev/null || echo "N/A")
VERSIONS+=("$v")
done
UNIQUE=($(printf '%s\n' "${VERSIONS[@]}" | sort -u))
if [[ ${#UNIQUE[@]} -ne 1 ]]; then
echo "::error::Version mismatch across platforms: ${UNIQUE[*]}"
echo "## ❌ Version Mismatch" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Expected all platforms to have the same version, but found: ${UNIQUE[*]}" >> $GITHUB_STEP_SUMMARY
exit 1
fi
echo "## Build Version: \`${UNIQUE[0]}\`" >> $GITHUB_STEP_SUMMARY

File Metadata

Mime Type
text/plain
Expires
Sun, May 3, 9:50 AM (4 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
544100
Default Alt Text
build.yml (2 KB)

Event Timeline