neovide.neovide/macos-builder/readme.md
Alexsander Falcucci 3e22aaaf5d
feat: create apple code signing and notarization (#2814)
* feat: improve code signing for macos systems

- add code to sign mac app for macos-12
- include signing for aarch64-apple-darwin and x86_64-apple-darwin systems

* feat: streamline macos app notarization and signing	process

- add a step to write apple signing key to a file for macos
- add a step to write app store connect api key to a file for macos
- modify the conditional check for signing the mac app for macos
- add a step to notarize signed macos apps for both architectures

* ci: update github actions matrix for macos build workflow

- update the matrix condition from 'macos' to 'macos-latest' for various steps in the workflow build
- adjust the condition for signing keys based on the updated matrix value

* feat: update workflow job names and sign mac app binaries

- update the workflow job names to differentiate between signing the binary and the .dmg for mac app in different architectures.
- add a new step to sign the mac app binary for aarch64 and x86_64 architecture.

* feat: enhance code security with code signing improvements

- add code signing for mac applications
- implement code signing flags for better security

* ci: refactor github actions workflow configuration

- remove notarization steps for macos `aarch64-apple-darwin` and `x86_64-apple-darwin` devices
- modify the `upload-artifact` step in the workflow

* build: refactor artifact creation and handling in macos workflow

- modify artifact creation in build workflow for macos
- add step to set artifacts for macos only
- update handling of artifacts in the build workflow

* build: improve notarization process for macos files

- update workflow to notarize signed macos files for both architectures
- add notarization step for aarch64-apple-darwin architecture
- add notarization step for x86_64-apple-darwin architecture

* build: implement code signing for mac app binaries

- add signing step for mac app binary root (aarch64-apple-darwin)
- add signing step for mac app binary root (x86_64-apple-darwin)

* build: sign macos binaries with developer id

- update build script to sign the macos binaries with a developer id
- modify the build workflow to include the developer id as a secret
- adjust the macos build script to allow passing a developer id as a parameter

* fix: standardize code formatting across project files

- fix a typo in the secret placeholders
- update the paths in the script to use double quotes for consistency

* ci: refactor github actions for consistent build process

- remove file preparation steps for different operating systems in .github/workflows/build.yml
- rename action for signing mac app binaries in .github/workflows/build.yml
- comment out previous code signing commands in macos-builder/run

* chore: refactor macos code signing and ci config

- comment out the lines related to signing mac app binaries for aarch64 and x86_64-apple-darwin
- update the `prepare artifacts` step in the yaml file

* feat: improve macos deployment process

- add a step to create `neovide.app` for macos
- include commands to generate `neovide.app` for different architectures
- add a step to sign the mac app binary for both architectures
- add a step to sign the `neovide.app` for both architectures
- modify the prepare artifacts step to generate `.dmg` files for mac
- print messages about generating bundle app and dmg in `macos-builder/run`

* fix: streamline macos signing process

- remove redundant command for creating .dmg for aarch64-apple-darwin
- add `staple: true` for notarizing signed macos files

* build: refactor build steps for multi-platform support

- separated the build step into platform-specific jobs for windows, macos, and linux
- included conditions for specific os versions for each platform
- adjusted build commands based on the platform and os requirements

* build: improve platform-specific installation and preparation instructions

- add windows-specific installation steps for dependencies
- add macos-specific installation steps for dependencies
- add linux-specific installation steps for dependencies
- add windows-specific preparation steps for artifacts
- add macos-specific preparation steps for artifacts
- add linux-specific preparation steps for artifacts
- update code comments in `macos-builder/run` file

* refactor: refactor macos build scripts and github actions

- add `continue-on-error: true` to the macos notarization jobs
- remove unnecessary echo statements in the macos builder script

* feat: refine github event handling and macos signing workflow

- update conditional to include a check for the github event repository
- specify the binary input path in the mac signing steps
- add notarisation step for signed macos binaries

* refactor: refactor dmg generation process

- remove redundant if statement for `$generate_dmg`
- initialize signing process for dmg creation

* fix a typo in the github action name

* chore: refactor build scripts and improve environment variable handling

- update the run script command to include environment variables to generate bundle app and dmg

* ci: refactor github action workflows for code signing and notarization

- update github action workflow conditions to check for the main branch instead of a specific repository both for signing keys and code signing
- reorganize signing steps for mac app binaries and .app bundles
- adjust workflow to notarize signed macos apps for both architectures on the main branch
2024-11-06 02:39:14 +01:00

2.5 KiB

Neovide Packaging for macOS

This script is designed to build (if needed) and package the Neovide application packaging it into a macOS .app bundle, and then creating a .dmg disk image for distribution.

Prerequisites

Before running the script, ensure you have the following dependencies installed:

Run the Script:

GENERATE_BUNDLE_APP=true GENERATE_DMG=true ./macos-builder/run aarch64-apple-darwin

Steps

Set Up Release Directory: The script sets the RELEASE_DIR based on the TARGET_ARCHITECTURE environment variable. If TARGET_ARCHITECTURE is not set, it defaults to target/release.

RELEASE_DIR=${TARGET_ARCHITECTURE:+target/${TARGET_ARCHITECTURE}/release}
RELEASE_DIR=${RELEASE_DIR:-target/release}

Build the Project: If the release directory does not exist, the script runs the cargo build --release command to build the project.

This is for local development purposes since you would typically build the project beforehand.

if [ ! -d "${RELEASE_DIR}" ]; then
  cargo build --release ${TARGET_ARCHITECTURE:+--target "${TARGET_ARCHITECTURE}"}
fi

Prepare the Application Bundle:

  • Sets up directories for the .app bundle.
  • Copies the built binary and other necessary resources into the bundle.
  • Signs the application using codesign.
mkdir -p "${APP_BINARY_DIR}"
mkdir -p "${APP_EXTRAS_DIR}"
cp -fRp "${APP_TEMPLATE}" "${APP_DIR}"
cp -fp "${APP_BINARY}" "${APP_BINARY_DIR}"
touch -r "${APP_BINARY}" "${APP_DIR}/${APP_NAME}"
codesign --remove-signature "${APP_DIR}/${APP_NAME}"
codesign --force --deep --sign - "${APP_DIR}/${APP_NAME}"

Create the Disk Image: Uses create-dmg to create a .dmg file for the application.

create-dmg \
  --filesystem "${DMG_FILESYSTEM}" \
  --format "${DMG_FORMAT}" \
  --volname "${DMG_VOLNAME}" \
  --volicon "${DMG_ICNS}" \
  --background "${DMG_BACKGROUND}" \
  --window-size 650 470 \
  --icon-size 80 \
  --icon Neovide.app 240 320 \
  --app-drop-link 410 320 \
  "${APP_DIR}/${DMG_NAME}" \
  "${APP_DIR}/${APP_NAME}"

Notes

  • Ensure all paths and filenames are correct and that the necessary files (like Neovide.icns and neovide-dmg-background.tiff) are present in their respective directories.
  • The script assumes a macOS environment with the necessary tools installed.