diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8fbdc028..272017b4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,8 +19,8 @@ jobs: platform: - { runner: windows-latest, os: windows, arch: x64, archive_ext: .zip } - { runner: ubuntu-latest, os: linux, arch: x86_64, archive_ext: .tar.gz } - - { runner: macos-12, os: macos, arch: x86_64, archive_ext: .tar.gz } - - { runner: macos-14, os: macos, arch: arm64, archive_ext: .tar.gz } + - { runner: macos-latest, os: macos, arch: x86_64, archive_ext: .tar.gz } + - { runner: macos-latest, os: macos, arch: arm64, archive_ext: .tar.gz } mode: [debug, releasedbg] runs-on: ${{ matrix.platform.runner }} @@ -31,8 +31,11 @@ jobs: run: echo "key=$(date +'%W')" >> $GITHUB_OUTPUT shell: bash - - name: "Set OUTPUT_FILE variable" - run: echo "OUTPUT_FILE=${{ matrix.platform.os }}_${{ matrix.platform.arch }}_${{ matrix.mode }}${{ matrix.platform.archive_ext }}" >> $GITHUB_ENV + - name: "Set output variables" + run: | + OUTPUT_NAME=${{ matrix.platform.os }}_${{ matrix.platform.arch }}_${{ matrix.mode }} + echo "OUTPUT_NAME=$OUTPUT_NAME" >> $GITHUB_ENV + echo "OUTPUT_FILE=$OUTPUT_NAME${{ matrix.platform.archive_ext }}" >> $GITHUB_ENV shell: bash # Force xmake to a specific folder (for cache) @@ -86,26 +89,29 @@ jobs: - name: Install run: | - xmake install -vo dest/ + xmake install -vo output/ if [ "$RUNNER_OS" == "Linux" ]; then - mv ./dest/lib/*.so* ./dest/bin/ + mv ./output/lib/*.so* ./output/bin/ elif [ "$RUNNER_OS" == "macOS" ]; then - mv ./dest/lib/*.dylib* ./dest/bin/ + mv ./output/lib/*.dylib* ./output/bin/ fi - rm -rf dest/include/ - rm -rf dest/lib/ + rm -rf output/include/ + rm -rf output/lib/ + mv output/bin ${{ env.OUTPUT_NAME }} shell: bash - # For some reason macOS-14 doesn't seem to have Python - - uses: actions/setup-python@v5 - if: ${{ matrix.platform.runner == 'macos-14' }} + - name: Upload artifact + uses: actions/upload-artifact@v4 with: - python-version: "3.11" + name: artifact-${{ env.OUTPUT_NAME }} + path: ${{ env.OUTPUT_NAME }} + if-no-files-found: error + retention-days: 1 - name: Archive result uses: ihiroky/archive-action@v1 with: - root_dir: dest/bin + root_dir: ${{ env.OUTPUT_NAME }} file_path: ${{ env.OUTPUT_FILE }} verbose: true @@ -160,3 +166,26 @@ jobs: asset_name: ${{ env.OUTPUT_FILE }}.sha256 tag: ${{ github.ref }} overwrite: true + + build-macos-universal: + strategy: + fail-fast: false + matrix: + mode: [debug, releasedbg] + + runs-on: macos-latest + needs: build + steps: + - name: Download x86_64 binaries + uses: actions/download-artifact@v4 + with: + name: artifact-macOS_x86_64_${{ matrix.mode }} + path: output/x86_64 + + - name: Download arm64 binaries + uses: actions/download-artifact@v4 + with: + name: artifact-macOS_arm64_${{ matrix.mode }} + path: output/arm64 + + - run: ls -R output