From b52dc22be2e175ac335242d68a0cdb4bce6f2dc9 Mon Sep 17 00:00:00 2001 From: Brett Mayson Date: Fri, 18 Oct 2024 00:36:12 +0000 Subject: [PATCH] release for macos --- .github/workflows/build.yaml | 46 +++++++++++++++++++++++++++++------- .github/workflows/test.yaml | 4 +++- bin/src/commands/build.rs | 4 ++++ bin/src/commands/dev.rs | 4 ++++ 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7e291ff7..f5707613 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,6 +27,16 @@ jobs: name: windows artifact: windows-x64 exe: hemtt.exe + # Intel Mac + - runner: macos-13 + name: macos-x64 + artifact: macos-x64 + exe: hemtt + # ARM Mac + - runner: macos-latest + name: macos-arm + artifact: macos-arm64 + exe: hemtt steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -63,6 +73,12 @@ jobs: - runner: windows-latest name: windows artifact: windows-x64 + - runner: macos-13 + name: macos-x64 + artifact: macos-x64 + - runner: macos-latest + name: macos-arm + artifact: macos-arm64 mod: - repo: CBATeam/CBA_A3 commit: b99dddf46aca7cea008bca56f5a553c5d7776219 @@ -88,8 +104,8 @@ jobs: repository: ${{ matrix.mod.repo }} path: mod ref: ${{ matrix.mod.commit }} - - name: Install Linux - if: startsWith(matrix.os.runner, 'ubuntu') + - name: Install Linux & MacOS + if: startsWith(matrix.os.runner, 'ubuntu') || startsWith(matrix.os.runner, 'macos') run: | cd hemtt && cp hemtt /usr/local/bin/hemtt && chmod +x /usr/local/bin/hemtt - name: Install Windows @@ -130,20 +146,34 @@ jobs: name: windows-x64 path: release + - name: Download MacOS x64 + uses: actions/download-artifact@v4 + with: + name: macos-x64 + path: release + + - name: Download MacOS ARM64 + uses: actions/download-artifact@v4 + with: + name: macos-arm64 + path: release + - name: Zip Linux x64 run: | cd release && zip linux-x64.zip hemtt && rm hemtt - - name: Create Release Version - run: | - VERSION=${GITHUB_REF_NAME#v} - echo Version: $VERSION - echo "VERSION=$VERSION" >> $GITHUB_ENV - - name: Zip Windows x64 run: | cd release && zip windows-x64.zip hemtt.exe && rm hemtt.exe + - name: Zip MacOS x64 + run: | + cd macos-x64 && zip macos-x64.zip hemtt && rm hemtt + + - name: Zip MacOS ARM64 + run: | + cd macos-arm64 && zip macos-arm64.zip hemtt && rm hemtt + - name: Release uses: softprops/action-gh-release@v2 with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 93539a2f..0590a74c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,8 +23,10 @@ jobs: name: ubuntu - runner: windows-latest name: windows + - runner: macos-13 + name: macos-x64 - runner: macos-latest - name: macos + name: macos-arm toolchain: - stable - beta diff --git a/bin/src/commands/build.rs b/bin/src/commands/build.rs index 27ffed80..0f58f3d3 100644 --- a/bin/src/commands/build.rs +++ b/bin/src/commands/build.rs @@ -93,6 +93,10 @@ pub fn executor(ctx: Context, matches: &ArgMatches) -> Executor { let mut executor = Executor::new(ctx); let use_asc = matches.get_one::("asc") == Some(&true); + if cfg!(target_os = "macos") && use_asc { + error!("ArmaScriptCompiler is not supported on macOS"); + std::process::exit(1); + } executor.collapse(Collapse::No); diff --git a/bin/src/commands/dev.rs b/bin/src/commands/dev.rs index 30777b15..5064fdc4 100644 --- a/bin/src/commands/dev.rs +++ b/bin/src/commands/dev.rs @@ -133,6 +133,10 @@ pub fn context( } let use_asc = matches.get_one::("asc") == Some(&true); + if cfg!(target_os = "macos") && use_asc { + error!("ArmaScriptCompiler is not supported on macOS"); + std::process::exit(1); + } let mut executor = Executor::new(ctx);