diff --git a/.github/workflows/create-macos-distribution-packaging.yml b/.github/workflows/create-macos-distribution-packaging.yml new file mode 100644 index 000000000..6cf767c8d --- /dev/null +++ b/.github/workflows/create-macos-distribution-packaging.yml @@ -0,0 +1,78 @@ +name: Build & Package (macOS) + +on: + push: + tags: + - '*' + pull_request: + paths: + - 'inflection/**' + - '.github/workflows/create-macos-distribution-packaging.yml' + workflow_dispatch: + +jobs: + build-and-package: + runs-on: macos-latest + env: + ICU_MAJOR: '78' + ICU_MINOR: '3' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: true + + - name: Setup Git LFS + run: | + git lfs install + git lfs pull + + - name: Install system dependencies (Homebrew) + run: | + brew install icu4c libxml2 cmake pkg-config + + - name: Configure & Build + run: | + ICU_PREFIX=$(brew --prefix icu4c) + XML2_PREFIX=$(brew --prefix libxml2) + export PKG_CONFIG_PATH="$ICU_PREFIX/lib/pkgconfig:$XML2_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" + mkdir -p inflection/build + cd inflection/build + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DICU_ROOT="$ICU_PREFIX" \ + -DCMAKE_PREFIX_PATH="$ICU_PREFIX;$XML2_PREFIX" + make -j$(sysctl -n hw.ncpu) + + - name: Run tests + run: | + ICU_PREFIX=$(brew --prefix icu4c) + XML2_PREFIX=$(brew --prefix libxml2) + export PKG_CONFIG_PATH="$ICU_PREFIX/lib/pkgconfig:$XML2_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" + export DYLD_LIBRARY_PATH="$ICU_PREFIX/lib:$DYLD_LIBRARY_PATH" + cd inflection/build + make check + + - name: Package with CPack + run: | + cd inflection/build + cpack -G TGZ + ls -la *.tar.gz + + - name: Upload release artifacts + uses: actions/upload-artifact@v4 + with: + name: macos-release-artifacts + path: | + inflection/build/*.tar.gz + retention-days: 30 + + - name: Upload to GitHub Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + name: "Release ${{ github.ref_name }}" + files: | + inflection/build/*.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}