-
Notifications
You must be signed in to change notification settings - Fork 25
61 lines (54 loc) · 1.92 KB
/
release-mac.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build and release for macOS
on:
push:
branches:
- main
permissions:
contents: write
jobs:
check_version:
uses: ./.github/workflows/check-version.yml
macos-build:
needs: [check_version]
if: ${{ needs.check_version.outputs.should_run != 'false' }}
runs-on: ${{ matrix.runner }}
name: Build Mac ${{ matrix.arch }}
strategy:
fail-fast: true
matrix:
include:
- arch: x86_64
runner: macos-13
- arch: arm64
runner: macos-14
# Thanks for your contribution @noahlias!
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.25.2
ninjaVersion: 1.11.1
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
- name: Build project
run: |
export DEVELOPER_DIR=/Applications/Xcode_14.3.1.app/Contents/Developer
sudo xcode-select -s $DEVELOPER_DIR
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -S . -B build
cmake --build build
cmake --install build --prefix prefix
cp LICENSE.txt prefix/lib/awrit/LICENSE
tar cJf awrit-mac-${{ matrix.arch }}.tar.xz -C prefix .
shasum -a 256 awrit-mac-${{ matrix.arch }}.tar.xz > awrit-mac-${{ matrix.arch }}.tar.xz.sha256sum
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "awrit-mac-${{ matrix.arch }}.tar.xz,awrit-mac-${{ matrix.arch }}.tar.xz.sha256sum"
allowUpdates: true
artifactErrorsFailBuild: true
name: ${{ needs.check_version.outputs.version }}
tag: ${{ needs.check_version.outputs.version }}
body: |
This is an automated release built from the `main` branch.
For changes, please review the commit log.