diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8e179d..e83dfe7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,4 +68,32 @@ jobs: uses: actions/upload-artifact@v3 with: name: native - path: output/ \ No newline at end of file + path: output/ + + mac_os_compile: + runs-on: macos-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Make Directory + run: mkdir output + + - name: Install Java 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Compile + run: gcc -c -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin ${{ env.PATH_TO_CODE }}.c -o ${{ env.PATH_TO_CODE }}_x64.o + + - name: Link + run: gcc -dynamiclib -o output/${{ env.LIB_NAME }}_x64.dylib ${{ env.PATH_TO_CODE }}_x64.o -lc + + - name: Upload Natives + uses: actions/upload-artifact@v3 + with: + name: native + path: output/ +