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

split build test #55

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
90 changes: 90 additions & 0 deletions .github/workflows/release-test-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Release Test

on:
pull_request:
paths:
- .github/workflows/release-test-macos.yml

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_TERM_COLOR: always

jobs:
macos:
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
include:
- rust-arch: aarch64
darwin-arch: arm64
runs-on: macos-14

- rust-arch: aarch64
darwin-arch: x86_64
runs-on: macos-13

- rust-arch: aarch64
darwin-arch: x86_64
runs-on: macos-12

- rust-arch: aarch64
darwin-arch: x86_64
runs-on: macos-11
env:
RELEASE_TAG_NAME: nightly

NOTARIZE_USERNAME: ${{ secrets.NOTARIZE_USERNAME }}
NOTARIZE_PASSWORD: ${{ secrets.NOTARIZE_PASSWORD }}

APP_NAME: Lapce-macos-${{ matrix.rust-arch }}.app
DMG_NAME: lapce-macos-${{ matrix.rust-arch }}.dmg

RELEASE_DIR: ./target/${{ matrix.rust-arch }}-apple-darwin/release-lto

CARGO_BUILD_TARGET: ${{ matrix.rust-arch }}-apple-darwin
steps:
- uses: actions/checkout@v4

- name: Update rust
run: rustup update && rustup target add ${{ env.CARGO_BUILD_TARGET }}

- name: Import Certificate
uses: Apple-Actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}

- name: Fetch dependencies
run: cargo fetch --locked

- name: Make DMG
run: make dmg

- name: Rename
run: |
cp ${{ env.RELEASE_DIR }}/macos/Lapce.dmg ${{ env.RELEASE_DIR }}/macos/${{ env.DMG_NAME }}

- name: Notarize Release Build
uses: lando/notarize-action@v2
with:
product-path: "${{ env.RELEASE_DIR }}/macos/${{ env.DMG_NAME }}"
appstore-connect-username: ${{ secrets.NOTARIZE_USERNAME }}
appstore-connect-password: ${{ secrets.NOTARIZE_PASSWORD }}
appstore-connect-team-id: CYSGAZFR8D
primary-bundle-id: "io.lapce"

- name: "Staple Release Build"
uses: lapce/xcode-staple@062485d6eeafe841c18a412f012e80f49e23c517
with:
product-path: "${{ env.RELEASE_DIR }}/macos/${{ env.DMG_NAME }}"

- uses: actions/upload-artifact@v4
with:
name: lapce-macos-${{ matrix.runs-on }}
path: |
${{ env.RELEASE_DIR }}/macos/${{ env.DMG_NAME }}
retention-days: 7
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ TARGET = lapce
CODESIGN_IDENTITY = FAC8FBEA99169DC1980731029648F110628D6A32

ASSETS_DIR = extra
RELEASE_DIR = target/release-lto
RELEASE_DIR ?= target/release-lto

MACOSX_DEPLOYMENT_TARGET ?= 10.11

APP_NAME = Lapce.app
APP_TEMPLATE = $(ASSETS_DIR)/macos/$(APP_NAME)
Expand Down Expand Up @@ -31,11 +33,11 @@ ubuntu-deps:
binary: $(TARGET)-native ## Build a release binary
binary-universal: $(TARGET)-universal ## Build a universal release binary
$(TARGET)-native:
MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --profile release-lto
@lipo target/release-lto/$(TARGET) -create -output $(APP_BINARY)
cargo build --profile release-lto
@lipo $(RELEASE_DIR)/$(TARGET) -create -output $(APP_BINARY)
$(TARGET)-universal:
MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --profile release-lto --target=x86_64-apple-darwin
MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --profile release-lto --target=aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET="11.0" cargo build --profile release-lto --target=aarch64-apple-darwin
@lipo target/{x86_64,aarch64}-apple-darwin/release-lto/$(TARGET) -create -output $(APP_BINARY)
/usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --strict --options=runtime --force -s $(CODESIGN_IDENTITY) $(APP_BINARY)

Expand Down
Loading