summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2021-08-17 18:04:46 +0000
committerGitHub <noreply@github.com>2021-08-17 18:04:46 +0000
commitabed2e97488f57d37743f090c16c12eff812b2ce (patch)
tree94d96e0a88cad49c7d2d12a0957e0aadebf91cc0
parentc24d7dfd0d2d8849f0398d7cb1a65d6562ee7a0d (diff)
downloadalacritty-abed2e97488f57d37743f090c16c12eff812b2ce.tar.gz
alacritty-abed2e97488f57d37743f090c16c12eff812b2ce.zip
Add macOS ARM builds to CI
-rw-r--r--.github/workflows/ci.yml8
-rw-r--r--.github/workflows/release.yml10
-rw-r--r--CHANGELOG.md5
-rw-r--r--INSTALL.md10
-rw-r--r--Makefile35
5 files changed, 52 insertions, 16 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1b51876f..f0b713cb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -25,3 +25,11 @@ jobs:
run: |
rustup component add clippy
cargo clippy --all-targets
+ check-macos-arm:
+ runs-on: macos-11
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install target
+ run: rustup update && rustup target add aarch64-apple-darwin
+ - name: Check build
+ run: cargo check --target=aarch64-apple-darwin
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 682e344b..ae8dc448 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -10,14 +10,18 @@ env:
jobs:
macos:
- runs-on: macos-latest
+ runs-on: macos-11
steps:
- uses: actions/checkout@v2
+ - name: Install ARM target
+ run: rustup update && rustup target add aarch64-apple-darwin
- name: Test
run: cargo test --release
- - name: Make App
- run: make dmg
+ - name: Test ARM
+ run: cargo test --release --target=aarch64-apple-darwin
+ - name: Make DMG
+ run: make dmg-universal
- name: Upload Application
run: |
mv ./target/release/osx/Alacritty.dmg ./Alacritty-${GITHUB_REF##*/}.dmg
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b5fe851b..a752821e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -52,6 +52,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Minimum Rust version has been bumped to 1.45.0
+### Packaging
+
+- Updated shell completions
+- Added ARM executable to prebuilt macOS binaries
+
### Added
- IME composition preview not appearing on Windows
diff --git a/INSTALL.md b/INSTALL.md
index bf3f0c65..c3be2eb5 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -251,6 +251,16 @@ make app
cp -r target/release/osx/Alacritty.app /Applications/
```
+#### Universal Binary
+
+The following will build an executable that runs on both x86 and ARM macos
+architectures:
+
+```sh
+rustup target add x86_64-apple-darwin aarch64-apple-darwin
+make app-universal
+```
+
## Post Build
There are some extra things you might want to set up after installing Alacritty.
diff --git a/Makefile b/Makefile
index 85983fae..b8548166 100644
--- a/Makefile
+++ b/Makefile
@@ -26,15 +26,21 @@ vpath $(DMG_NAME) $(APP_DIR)
all: help
-help: ## Prints help for targets with comments
+help: ## Print this help message
@grep -E '^[a-zA-Z._-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
-binary: | $(TARGET) ## Build release binary with cargo
-$(TARGET):
+binary: $(TAGET)-native ## Build a release binary
+binary-universal: $(TAGET)-universal ## Build a universal release binary
+$(TARGET)-native:
MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --release
+$(TARGET)-universal:
+ MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --release --target=x86_64-apple-darwin
+ MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --release --target=aarch64-apple-darwin
+ @lipo target/{x86_64,aarch64}-apple-darwin/release/$(TARGET) -create -output $(APP_BINARY)
-app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary
-$(APP_NAME): $(TARGET)
+app: $(APP_NAME)-native ## Create an Alacritty.app
+app-universal: $(APP_NAME)-universal ## Create a universal Alacritty.app
+$(APP_NAME)-%: $(TARGET)-%
@mkdir -p $(APP_BINARY_DIR)
@mkdir -p $(APP_EXTRAS_DIR)
@mkdir -p $(APP_COMPLETIONS_DIR)
@@ -44,10 +50,11 @@ $(APP_NAME): $(TARGET)
@cp -fp $(APP_BINARY) $(APP_BINARY_DIR)
@cp -fp $(COMPLETIONS) $(APP_COMPLETIONS_DIR)
@touch -r "$(APP_BINARY)" "$(APP_DIR)/$(APP_NAME)"
- @echo "Created '$@' in '$(APP_DIR)'"
+ @echo "Created '$(APP_NAME)' in '$(APP_DIR)'"
-dmg: | $(DMG_NAME) ## Pack Alacritty.app into .dmg
-$(DMG_NAME): $(APP_NAME)
+dmg: $(DMG_NAME)-native ## Create an Alacritty.dmg
+dmg-universal: $(DMG_NAME)-universal ## Create a universal Alacritty.dmg
+$(DMG_NAME)-%: $(APP_NAME)-%
@echo "Packing disk image..."
@ln -sf /Applications $(DMG_DIR)/Applications
@hdiutil create $(DMG_DIR)/$(DMG_NAME) \
@@ -55,12 +62,14 @@ $(DMG_NAME): $(APP_NAME)
-fs HFS+ \
-srcfolder $(APP_DIR) \
-ov -format UDZO
- @echo "Packed '$@' in '$(APP_DIR)'"
+ @echo "Packed '$(APP_NAME)' in '$(APP_DIR)'"
-install: $(DMG_NAME) ## Mount disk image
+install: $(INSTALL)-native ## Mount disk image
+install-universal: $(INSTALL)-native ## Mount universal disk image
+$(INSTALL)-%: $(DMG_NAME)-%
@open $(DMG_DIR)/$(DMG_NAME)
-.PHONY: app binary clean dmg install $(TARGET)
+.PHONY: app binary clean dmg install $(TARGET) $(TARGET)-universal
-clean: ## Remove all artifacts
- -rm -rf $(APP_DIR)
+clean: ## Remove all build artifacts
+ @cargo clean