Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update macOS CI #36

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 43 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Loading