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

Release test #56

Open
wants to merge 12 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
76 changes: 76 additions & 0 deletions .github/workflows/release-test-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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-12
env:
RELEASE_TAG_NAME: ${{ needs.tagname.outputs.tag_name }}

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

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

- name: Update rust
run: rustup update && rustup target add aarch64-apple-darwin

- 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-universal

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

- name: Notarize Release Build
uses: lando/notarize-action@v2
with:
product-path: "./target/release-lto/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: "./target/release-lto/macos/${{ env.DMG_NAME }}"

- uses: actions/upload-artifact@v4
with:
name: lapce-macos-${{ matrix.rust-arch }}
path: |
./target/release-lto/macos/${{ env.DMG_NAME }}
retention-days: 1
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ 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
cargo build --profile release-lto
@lipo target/release-lto/$(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=x86_64-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)
/usr/bin/codesign -vvv --deep --timestamp --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(APP_BINARY)

app: $(APP_NAME)-native ## Create a Lapce.app
app-universal: $(APP_NAME)-universal ## Create a universal Lapce.app
Expand All @@ -50,7 +50,7 @@ $(APP_NAME)-%: $(TARGET)-%
@echo "Created '$(APP_NAME)' in '$(APP_DIR)'"
xattr -c $(APP_DIR)/$(APP_NAME)/Contents/Info.plist
xattr -c $(APP_DIR)/$(APP_NAME)/Contents/Resources/lapce.icns
/usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --strict --options=runtime --force -s $(CODESIGN_IDENTITY) $(APP_DIR)/$(APP_NAME)
/usr/bin/codesign -vvv --deep --timestamp --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(APP_DIR)/$(APP_NAME)

dmg: $(DMG_NAME)-native ## Create a Lapce.dmg
dmg-universal: $(DMG_NAME)-universal ## Create a universal Lapce.dmg
Expand All @@ -63,7 +63,7 @@ $(DMG_NAME)-%: $(APP_NAME)-%
-srcfolder $(APP_DIR) \
-ov -format UDZO
@echo "Packed '$(APP_NAME)' in '$(APP_DIR)'"
/usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --strict --options=runtime --force -s $(CODESIGN_IDENTITY) $(DMG_DIR)/$(DMG_NAME)
/usr/bin/codesign -vvv --deep --timestamp --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(DMG_DIR)/$(DMG_NAME)

install: $(INSTALL)-native ## Mount disk image
install-universal: $(INSTALL)-native ## Mount universal disk image
Expand Down
Loading