ci: use latest macos images (#1804)

* ci: use latest macos images

* ci/build: clarify the purpose of md5sha1sum

* meson.build: remove hidapi usage

* ci: downgrade macos version for universal build

* scripts: codesign the universal binary with sha1 and sha256

* ci: revert back to macos-14 for universal

* ci/build: remove old comment
This commit is contained in:
Takase 2024-06-18 11:38:41 +08:00 committed by GitHub
parent 39ba860645
commit a9d918901e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 39 additions and 25 deletions

View File

@ -65,13 +65,16 @@ jobs:
build_macos: build_macos:
name: macOS name: macOS
runs-on: macos-11 strategy:
matrix:
config:
- { arch: x86_64, runner: macos-13 } # macos-13 uses x86_64
- { arch: arm64, runner: macos-14 } # macos-14 / latest uses M1
runs-on: ${{ matrix.config.runner }}
env: env:
CC: clang CC: clang
CXX: clang++ CXX: clang++
strategy:
matrix:
arch: ["x86_64", "arm64"]
steps: steps:
- name: System Information - name: System Information
@ -85,8 +88,7 @@ jobs:
run: | run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH" echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV" echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-macos-${{ matrix.arch }}" >> "$GITHUB_ENV" echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-macos-${{ matrix.config.arch }}" >> "$GITHUB_ENV"
if [[ $(uname -m) != ${{ matrix.arch }} ]]; then echo "ARCH=--cross-arch ${{ matrix.arch }}" >> "$GITHUB_ENV"; fi
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -96,28 +98,30 @@ jobs:
with: with:
python-version: "3.11" python-version: "3.11"
# --lhelper will eliminate a warning with arm64 and libusb # installing md5sha1sum will eliminate a warning with arm64 and libusb
- name: Install Dependencies - name: Install Dependencies
run: bash scripts/install-dependencies.sh --debug --lhelper run: |
brew install bash md5sha1sum
pip install meson ninja dmgbuild
- name: Build - name: Build
run: | run: |
bash --version bash --version
bash scripts/build.sh --bundle --debug --forcefallback $ARCH bash scripts/build.sh --bundle --debug --forcefallback
- name: Create DMG Image - name: Create DMG Image
run: bash scripts/package.sh --version ${INSTALL_REF} $ARCH --debug --dmg run: bash scripts/package.sh --version ${INSTALL_REF} --debug --dmg
- name: Upload DMG Image - name: Upload DMG Image
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: macOS DMG Images (${{ matrix.arch }}) name: macOS DMG Images (${{ matrix.config.arch }})
path: ${{ env.INSTALL_NAME }}.dmg path: ${{ env.INSTALL_NAME }}.dmg
compression-level: 0 compression-level: 0
build_macos_universal: build_macos_universal:
name: macOS (Universal) name: macOS (Universal)
runs-on: macos-11 runs-on: macos-14
needs: build_macos needs: build_macos
steps: steps:

View File

@ -129,10 +129,13 @@ jobs:
build_macos: build_macos:
name: macOS name: macOS
needs: release needs: release
runs-on: macos-11
strategy: strategy:
matrix: matrix:
arch: [x86_64, arm64] config:
- { arch: x86_64, runner: macos-13 } # macos-13 uses x86_64
- { arch: arm64, runner: macos-14 } # macos-14 / latest uses M1
runs-on: ${{ matrix.config.runner }}
env: env:
CC: clang CC: clang
CXX: clang++ CXX: clang++
@ -149,9 +152,8 @@ jobs:
run: | run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH" echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo "INSTALL_REF=${{ needs.release.outputs.version }}" >> "$GITHUB_ENV" echo "INSTALL_REF=${{ needs.release.outputs.version }}" >> "$GITHUB_ENV"
echo "INSTALL_NAME=lite-xl-${{ needs.release.outputs.version }}-macos-${{ matrix.arch }}" >> "$GITHUB_ENV" echo "INSTALL_NAME=lite-xl-${{ needs.release.outputs.version }}-macos-${{ matrix.config.arch }}" >> "$GITHUB_ENV"
echo "INSTALL_NAME_ADDONS=lite-xl-${{ needs.release.outputs.version }}-addons-macos-${{ matrix.arch }}" >> "$GITHUB_ENV" echo "INSTALL_NAME_ADDONS=lite-xl-${{ needs.release.outputs.version }}-addons-macos-${{ matrix.config.arch }}" >> "$GITHUB_ENV"
if [[ $(uname -m) != ${{ matrix.arch }} ]]; then echo "ARCH=--cross-arch ${{ matrix.arch }}" >> "$GITHUB_ENV"; fi
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -162,22 +164,24 @@ jobs:
python-version: "3.11" python-version: "3.11"
- name: Install Dependencies - name: Install Dependencies
run: bash scripts/install-dependencies.sh --debug run: |
brew install bash md5sha1sum
pip install meson ninja dmgbuild
- name: Build - name: Build
run: | run: |
bash --version bash --version
bash scripts/build.sh --bundle --debug --forcefallback --release $ARCH bash scripts/build.sh --bundle --debug --forcefallback --release
- name: Create DMG Image - name: Create DMG Image
run: | run: |
bash scripts/package.sh --version ${INSTALL_REF} $ARCH --debug --dmg --release bash scripts/package.sh --version ${INSTALL_REF} --debug --dmg --release
bash scripts/package.sh --version ${INSTALL_REF} $ARCH --debug --addons --dmg --release bash scripts/package.sh --version ${INSTALL_REF} --debug --addons --dmg --release
- name: Upload Artifacts - name: Upload Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: macOS DMG Images (${{ matrix.arch }}) name: macOS DMG Images (${{ matrix.config.arch }})
path: | path: |
${{ env.INSTALL_NAME }}.dmg ${{ env.INSTALL_NAME }}.dmg
${{ env.INSTALL_NAME_ADDONS }}.dmg ${{ env.INSTALL_NAME_ADDONS }}.dmg
@ -185,7 +189,7 @@ jobs:
build_macos_universal: build_macos_universal:
name: macOS (Universal) name: macOS (Universal)
needs: [release, build_macos] needs: [release, build_macos]
runs-on: macos-11 runs-on: macos-14
steps: steps:
- name: System Information - name: System Information

View File

@ -123,7 +123,6 @@ if not get_option('source-only')
sdl_options += 'use_atomic=enabled' sdl_options += 'use_atomic=enabled'
sdl_options += 'use_threads=enabled' sdl_options += 'use_threads=enabled'
sdl_options += 'use_timers=enabled' sdl_options += 'use_timers=enabled'
sdl_options += 'with_main=true'
# investigate if this is truly needed # investigate if this is truly needed
# Do not remove before https://github.com/libsdl-org/SDL/issues/5413 is released # Do not remove before https://github.com/libsdl-org/SDL/issues/5413 is released
sdl_options += 'use_events=enabled' sdl_options += 'use_events=enabled'
@ -150,6 +149,7 @@ if not get_option('source-only')
sdl_options += 'test=false' sdl_options += 'test=false'
sdl_options += 'use_sensor=disabled' sdl_options += 'use_sensor=disabled'
sdl_options += 'use_haptic=disabled' sdl_options += 'use_haptic=disabled'
sdl_options += 'use_hidapi=disabled'
sdl_options += 'use_audio=disabled' sdl_options += 'use_audio=disabled'
sdl_options += 'use_cpuinfo=disabled' sdl_options += 'use_cpuinfo=disabled'
sdl_options += 'use_joystick=disabled' sdl_options += 'use_joystick=disabled'

View File

@ -30,4 +30,9 @@ done
lipo -create -output "Lite XL.app/Contents/MacOS/lite-xl" "$WORKDIR/"*-lite-xl lipo -create -output "Lite XL.app/Contents/MacOS/lite-xl" "$WORKDIR/"*-lite-xl
# https://eclecticlight.co/2019/01/17/code-signing-for-the-concerned-3-signing-an-app/
# https://wiki.lazarus.freepascal.org/Code_Signing_for_macOS#Big_Sur_and_later_on_Apple_M1_ARM64_processors
# codesign all the files again, hopefully this would fix signature validation
codesign --force --deep --digest-algorithm=sha1,sha256 -s - "Lite XL.app"
source scripts/appdmg.sh "$2" source scripts/appdmg.sh "$2"

View File

@ -270,7 +270,8 @@ main() {
if [[ $bundle == true ]]; then if [[ $bundle == true ]]; then
# https://eclecticlight.co/2019/01/17/code-signing-for-the-concerned-3-signing-an-app/ # https://eclecticlight.co/2019/01/17/code-signing-for-the-concerned-3-signing-an-app/
codesign --force --deep -s - "${dest_dir}" # https://wiki.lazarus.freepascal.org/Code_Signing_for_macOS#Big_Sur_and_later_on_Apple_M1_ARM64_processors
codesign --force --deep --digest-algorithm=sha1,sha256 -s - "${dest_dir}"
fi fi
echo "Creating a compressed archive ${package_name}" echo "Creating a compressed archive ${package_name}"