Skip to content

Commit

Permalink
Installer for Linux & MacOS (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettMayson authored Oct 18, 2024
1 parent c4d4960 commit 4d93c00
Show file tree
Hide file tree
Showing 13 changed files with 148 additions and 5,320 deletions.
50 changes: 40 additions & 10 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,19 +146,33 @@ jobs:
name: windows-x64
path: release

- name: Zip Linux x64
- 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: Rename Linux x64
run: |
cd release && mv hemtt linux-x64
- name: Rename Windows x64
run: |
cd release && zip linux-x64.zip hemtt && rm hemtt
cd release && mv hemtt.exe windows-x64
- name: Create Release Version
- name: Rename MacOS x64
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
cd macos-x64 && mv hemtt darwin-x64
- name: Zip Windows x64
- name: Rename MacOS ARM64
run: |
cd release && zip windows-x64.zip hemtt.exe && rm hemtt.exe
cd macos-arm64 && mv hemtt darwin-arm64
- name: Release
uses: softprops/action-gh-release@v2
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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ An opinionated build system for Arma 3 mods.
[![Codecov](https://img.shields.io/codecov/c/github/brettmayson/hemtt?style=flat-square&label=Coverage)](https://app.codecov.io/gh/brettmayson/hemtt)
[![ACE3 Discord](https://img.shields.io/badge/Discord-Join-darkviolet.svg?style=flat-square)](https://acemod.org/discord)

[The HEMTT Book](https://brettmayson.github.io/HEMTT)
[The HEMTT Book](https://hemtt.dev)

## Installation

[![GitHub](https://img.shields.io/badge/GitHub-lightblue.svg?style=flat-square)](https://github.com/BrettMayson/HEMTT/releases)
[![winstall](https://img.shields.io/badge/WinGet-lightblue.svg?style=flat-square)](https://winstall.app/apps/BrettMayson.HEMTT)

[Read it in the book](https://brettmayson.github.io/HEMTT/installation.html)
[Read it in the book](https://hemtt.dev/installation.html)

## Browser Extension

Expand Down
2 changes: 1 addition & 1 deletion bin/src/commands/book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn cli() -> Command {
/// # Errors
/// Will not return an error
pub fn execute(_: &ArgMatches) -> Result<Report, Error> {
if let Err(e) = webbrowser::open("https://brettmayson.github.io/HEMTT/") {
if let Err(e) = webbrowser::open("https://hemtt.dev/") {
eprintln!("Failed to open the HEMTT book: {e}");
}
Ok(Report::new())
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
4 changes: 2 additions & 2 deletions bin/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ fn version_check(
if supports_hyperlinks::on(supports_hyperlinks::Stream::Stdout) {
let link = terminal_link::Link::new(
"The HEMTT Book",
"https://brettmayson.github.io/HEMTT/configuration/version.html",
"https://hemtt.dev/configuration/version.html",
);
println!("\nRead more about Version Configuration in {link}");
} else {
println!("\nRead more about Version Configuration at https://brettmayson.github.io/HEMTT/configuration/version.html");
println!("\nRead more about Version Configuration at https://hemtt.dev/configuration/version.html");
}
}
hemtt_common::version::Error::ExpectedMajor => {
Expand Down
1 change: 1 addition & 0 deletions book/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
highlight.js
Loading

0 comments on commit 4d93c00

Please sign in to comment.