summaryrefslogtreecommitdiff
path: root/meshmc/.github/actions/setup-dependencies/macos/action.yml
diff options
context:
space:
mode:
Diffstat (limited to 'meshmc/.github/actions/setup-dependencies/macos/action.yml')
-rw-r--r--meshmc/.github/actions/setup-dependencies/macos/action.yml52
1 files changed, 52 insertions, 0 deletions
diff --git a/meshmc/.github/actions/setup-dependencies/macos/action.yml b/meshmc/.github/actions/setup-dependencies/macos/action.yml
new file mode 100644
index 0000000000..3eb5b37fa6
--- /dev/null
+++ b/meshmc/.github/actions/setup-dependencies/macos/action.yml
@@ -0,0 +1,52 @@
+name: Setup macOS dependencies
+
+inputs:
+ build-type:
+ description: Type for the build
+ required: true
+ default: Debug
+ github-token:
+ description: GitHub token for package feed authentication
+ required: true
+
+runs:
+ using: composite
+
+ steps:
+ - name: Install dependencies
+ shell: bash
+ run: |
+ brew update
+ brew install ninja extra-cmake-modules temurin@17 mono autoconf libarchive
+
+ - name: Set JAVA_HOME
+ shell: bash
+ run: |
+ echo "JAVA_HOME=$(/usr/libexec/java_home -v 17)" >> "$GITHUB_ENV"
+
+ - name: Setup vcpkg cache
+ if: ${{ inputs.build-type == 'Debug' }}
+ shell: bash
+ env:
+ USERNAME: ${{ github.repository_owner }}
+ GITHUB_TOKEN: ${{ inputs.github-token }}
+ FEED_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
+ NUGET_RW: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
+ run: |
+ mono `vcpkg fetch nuget | tail -n 1` \
+ sources add \
+ -Source "$FEED_URL" \
+ -StorePasswordInClearText \
+ -Name GitHubPackages \
+ -UserName "$USERNAME" \
+ -Password "$GITHUB_TOKEN"
+ mono `vcpkg fetch nuget | tail -n 1` \
+ setapikey "$GITHUB_TOKEN" \
+ -Source "$FEED_URL"
+ MODE=$( [ "$NUGET_RW" = "true" ] && echo "readwrite" || echo "read" )
+ echo "VCPKG_BINARY_SOURCES=clear;nuget,$FEED_URL,$MODE" >> "$GITHUB_ENV"
+
+ - name: Setup vcpkg environment
+ shell: bash
+ run: |
+ echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> "$GITHUB_ENV"