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: Version 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