diff --git a/.github/workflows/macos_build_m1.yml b/.github/workflows/macos_build_m1.yml index 380c7cf..b831c34 100644 --- a/.github/workflows/macos_build_m1.yml +++ b/.github/workflows/macos_build_m1.yml @@ -2,7 +2,9 @@ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs name: MacOS NodeJS-CMake - +env: + DMG_OUTPUT: ${{github.workspace}}${{ '/out/make/zip/darwin/arm64'}} + DMG_OUTPUT_INTEL: ${{github.workspace}}${{ '/out/make/zip/darwin/x64'}} on: push: branches: [ "master" ] @@ -11,21 +13,85 @@ on: workflow_dispatch: jobs: - build: + M1Build: runs-on: macos-latest strategy: matrix: - node-version: [18.x] + node-version: [24.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 with: - cmake-version: '3.16.x' + cmake-version: '4.0.x' + + - name: Show Swift version and architecture + run: | + swiftc --version + file $(which swiftc) + arch + + - name: Use cmake + run: cmake --version + + - name: Checkout Action + uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Install nodejs dependencies + run: npm i + + - name: Build + run: npm run make + + - name: Self-sign - Avoid Gatekeeper DMG corrupted warning + run: | + echo "Unzipping" + unzip -q ${{ env.DMG_OUTPUT }}/Playful*.zip -d ${{ env.DMG_OUTPUT }} + echo "Removing zip" + rm -rf ${{ env.DMG_OUTPUT }}/Playful*.zip + echo "Codesigning" + codesign --force --deep -s - ${{ env.DMG_OUTPUT }}/Playful.app + echo "Zipping" + cd ${{ env.DMG_OUTPUT }} && zip -q -r -y Playful_apple_silicon.zip Playful.app + echo "Removing .app" + rm -rf ${{ env.DMG_OUTPUT }}/Playful.app + + - name: Upload Build File + uses: actions/upload-artifact@v4 + with: + name: Playful-darwin-arm64 + path: ${{ env.DMG_OUTPUT }}/Playful_apple_silicon.zip + + IntelBuild: + + runs-on: macos-13 + + strategy: + matrix: + node-version: [24.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '4.0.x' + + - name: Show Swift version and architecture + run: | + swiftc --version + file $(which swiftc) + arch + - name: Use cmake run: cmake --version @@ -43,9 +109,23 @@ jobs: - name: Build run: npm run make + + - name: Self-sign - Avoid Gatekeeper DMG corrupted warning + run: | + echo "Unzipping" + cd ./out/make/zip/darwin/ && ls + unzip -q ${{ env.DMG_OUTPUT_INTEL }}/Playful*.zip -d ${{ env.DMG_OUTPUT_INTEL }} + echo "Removing zip" + rm -rf ${{ env.DMG_OUTPUT_INTEL }}/Playful*.zip + echo "Codesigning" + codesign --force --deep -s - ${{ env.DMG_OUTPUT_INTEL }}/Playful.app + echo "Zipping" + cd ${{ env.DMG_OUTPUT_INTEL }} && zip -q -r -y Playful_intel.zip Playful.app + echo "Removing .app" + rm -rf ${{ env.DMG_OUTPUT_INTEL }}/Playful.app - name: Upload Build File uses: actions/upload-artifact@v4 with: - name: Playful-darwin-amd64 - path: /Users/runner/work/Playful/Playful/out/make + name: Playful-darwin-intel + path: ${{ env.DMG_OUTPUT_INTEL }}/Playful_intel.zip