Clean the build dir between builds on Mac #332
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: macOS | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: macOS-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13.5' | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer | |
| - name: Build for ARM | |
| run: | | |
| export CFLAGS="$CFLAGS -w" | |
| export CXXFLAGS="$CXXFLAGS -w" | |
| ./configure --openssl-no-asm --without-intl --dest-cpu=arm64 --ninja | |
| make | |
| cp out/Release/node node-arm64 | |
| - name: Build for x64 | |
| env: | |
| DEPLOY: 10.13 | |
| run: | | |
| rm -rf out | |
| export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)" | |
| export CC="clang --target=x86_64-apple-darwin -isysroot $SDKROOT -mmacosx-version-min=$DEPLOY" | |
| export CXX="clang++ --target=x86_64-apple-darwin -isysroot $SDKROOT -mmacosx-version-min=$DEPLOY -stdlib=libc++" | |
| export CFLAGS="$CFLAGS -w" | |
| export CXXFLAGS="$CXXFLAGS -w" | |
| export LD="ld.lld -arch x86_64 -platform_version macos $DEPLOY 13.0" | |
| ./configure --openssl-no-asm --without-intl --dest-cpu=x86_64 --cross-compiling --ninja | |
| make | |
| cp out/Release/node node-x64 | |
| - name: Get KoreTools_macos | |
| run: git clone https://github.com/Kode/KoreTools_macos.git | |
| - name: Create Universal Binary | |
| run: | | |
| lipo -create node-arm64 node-x64 -output KoreTools_macos/kmake | |
| codesign --sign - --timestamp --force KoreTools_macos/kmake | |
| - name: Set name | |
| run: git config --global user.name "Robbot" | |
| - name: Set email | |
| run: git config --global user.email "robbot2019@robdangero.us" | |
| - name: Add binary | |
| run: git -C KoreTools_macos add . | |
| - name: Commit binary | |
| id: commit | |
| continue-on-error: true | |
| run: git -C KoreTools_macos commit -a -m "Update macOS binary to $GITHUB_SHA." | |
| - name: Tag binary | |
| if: steps.commit.outcome == 'success' | |
| run: git -C KoreTools_macos tag macos_$GITHUB_SHA | |
| - name: Push binary | |
| id: push1 | |
| if: steps.commit.outcome == 'success' | |
| continue-on-error: true | |
| run: git -C KoreTools_macos push https://Kode-Robbot:$ROBBOT_PASS@github.com/Kode/KoreTools_macos.git main --tags | |
| env: | |
| ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} | |
| - name: Pull | |
| if: steps.commit.outcome == 'success' && steps.push1.outcome != 'success' | |
| run: git -C KoreTools_macos pull --no-rebase | |
| - name: Push binary again | |
| if: steps.commit.outcome == 'success' && steps.push1.outcome != 'success' | |
| continue-on-error: true | |
| run: git -C KoreTools_macos push https://Kode-Robbot:$ROBBOT_PASS@github.com/Kode/KoreTools_macos.git main --tags | |
| env: | |
| ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} |