|
1 | 1 | name: mac |
2 | 2 |
|
3 | | -on: |
| 3 | +on: |
4 | 4 | push: |
| 5 | + branches: |
| 6 | + - '**' # Runs on push to any branch |
| 7 | + tags: |
| 8 | + - '*' # Runs on any tag push |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main # Runs on pull requests targeting the main branch |
5 | 12 |
|
6 | 13 | jobs: |
7 | 14 |
|
8 | 15 | build-mac: |
9 | 16 |
|
10 | | - runs-on: ${{ matrix.os }} |
11 | | - strategy: |
12 | | - matrix: |
13 | | - os: [macos-latest] |
| 17 | + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') |
| 18 | + runs-on: macos-latest |
14 | 19 |
|
15 | 20 | steps: |
16 | 21 | - uses: actions/checkout@v4 |
17 | 22 | with: |
18 | 23 | submodules: true |
19 | | - - name: set env vars |
20 | | - run: | |
21 | | - if [ ${{github.ref_name}} == 'juce8' ]; then |
22 | | - echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV" |
23 | | - elif [ ${{github.ref_name}} == 'testing-juce8' ]; then |
24 | | - echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV" |
25 | | - else |
26 | | - echo "Invalid branch : ${{github.ref_name}}" |
27 | | - exit 1 |
28 | | - fi |
29 | | - - uses: maxim-lobanov/setup-xcode@v1 |
30 | | - with: |
31 | | - xcode-version: latest-stable |
32 | 24 | - uses: actions/setup-python@v5 |
33 | 25 | with: |
34 | | - python-version: '3.12' |
| 26 | + python-version: '3.10' |
35 | 27 | - name: setup |
36 | 28 | run: | |
37 | 29 | cd ../.. |
38 | | - git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH |
| 30 | + git clone https://github.com/open-ephys/plugin-GUI.git --branch main --single-branch |
39 | 31 | cd plugin-GUI/Build && cmake -G "Xcode" .. |
40 | 32 | - name: build |
41 | 33 | run: | |
|
56 | 48 | build_dir: "Build/Release" |
57 | 49 | package: PythonProcessor-mac |
58 | 50 | run: | |
59 | | - plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]" | tail -1) |
| 51 | + plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1) |
60 | 52 | tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+") |
61 | 53 | new_plugin_ver=$tag-API$plugin_api |
62 | 54 | mkdir plugins |
|
75 | 67 | security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign |
76 | 68 | security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CI_KEYCHAIN_PWD build.keychain |
77 | 69 | /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v plugins/python-processor.bundle --deep --strict --timestamp --options=runtime |
78 | | - /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libpython3.12.dylib --deep --strict --timestamp --options=runtime |
| 70 | + /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libpython3.10.dylib --deep --strict --timestamp --options=runtime |
79 | 71 |
|
80 | 72 | /usr/bin/codesign -dv --verbose=4 plugins/python-processor.bundle |
81 | 73 |
|
@@ -108,13 +100,15 @@ jobs: |
108 | 100 |
|
109 | 101 | zipfile=${package}_${new_plugin_ver}.zip |
110 | 102 | echo "zipfile=${zipfile}" >> $GITHUB_ENV |
111 | | - zip -r -X $zipfile plugins shared |
| 103 | + mkdir temp_dir |
| 104 | + cp -R plugins shared temp_dir |
| 105 | + /usr/bin/ditto -c -k --sequesterRsrc temp_dir $zipfile |
112 | 106 | - uses: actions/upload-artifact@v4 |
113 | 107 | with: |
114 | 108 | name: ${{ env.zipfile }} |
115 | 109 | path: ${{ env.zipfile }} |
116 | 110 | - name: deploy |
117 | | - if: github.ref == 'refs/heads/testing-juce8' |
| 111 | + if: github.ref == 'refs/heads/main' |
118 | 112 | env: |
119 | 113 | secrets.ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.secrets.ARTIFACTORY_ACCESS_TOKEN }} |
120 | 114 | run: | |
|
0 commit comments