workflows: update upload-artifact to v4
[mfgtools.git] / .github / workflows / macOS.yaml
blob2c41afacaf80e98c86b8810c803fac52eadd6e95
1 name: macOS Build
3 on:
4   push:
5     branches:
6       - master
7     tags:
8       - uuu*
9   pull_request:
10     types:
11       - opened
12       - synchronize
14 jobs:
15   build:
16     name: macOS Build
17     runs-on: ${{ matrix.os }}
18     strategy:
19       matrix:
20         os:
21           - macos-14
22           - macos-13
24     steps:
25       - name: Checkout repository
26         uses: actions/checkout@v3
27         with:
28           fetch-depth: 0
30       - name: Set up environment
31         run: brew install libusb pkg-config zstd tinyxml2
33       - name: Build
34         run: |
35           git fetch --tags --force # Retrieve annotated tags. #issue 290
36           export PATH="/usr/local/Cellar/pkg-config/0.29.2_3/bin:${PATH}"; pkg-config --list-all; cmake -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl . ; make
38       - name: Rename_x86
39         if: matrix.os == 'macos-13'
40         run: cp uuu/uuu uuu_mac_x86
42       - name: Rename_arm
43         if: matrix.os == 'macos-14'
44         run: cp uuu/uuu uuu_mac_arm
46       - name: Upload Build Artifacts
47         if: matrix.os == 'macos-13'
48         uses: actions/upload-artifact@v4
49         with:
50           name: uuu_mac_x86
51           path: uuu_mac_x86
53       - name: Upload Build Artifacts
54         if: matrix.os == 'macos-14'
55         uses: actions/upload-artifact@v4
56         with:
57           name: uuu_mac_arm
58           path: uuu_mac_arm
60       - name: Create or Update Release
61         if: github.ref_type == 'tag'
62         uses: ncipollo/release-action@v1
63         with:
64           name: Release ${{ github.ref_name }}
65           tag: ${{ github.ref_name }}
66           commit: ${{ github.sha }}
67           allowUpdates: true
68           prerelease: true
69           artifacts: "uuu_mac_*"