Skip to content

Commit

Permalink
release for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettMayson committed Oct 18, 2024
1 parent f533f07 commit b52dc22
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
46 changes: 38 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions bin/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ pub fn executor(ctx: Context, matches: &ArgMatches) -> Executor {
let mut executor = Executor::new(ctx);

let use_asc = matches.get_one::<bool>("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);

Expand Down
4 changes: 4 additions & 0 deletions bin/src/commands/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ pub fn context(
}

let use_asc = matches.get_one::<bool>("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);

Expand Down

0 comments on commit b52dc22

Please sign in to comment.