-
Notifications
You must be signed in to change notification settings - Fork 53
135 lines (131 loc) · 5.21 KB
/
build-watchos.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: build-watchos
on:
push:
paths-ignore:
- '**/README.md'
pull_request:
paths-ignore:
- '**/README.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
TARGET: "watchos"
NO_FORCE: 1
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
USE_ARTIFACT: true
DISABLE_WORKFLOW: "true"
jobs:
pre-check:
runs-on: ubuntu-latest
outputs:
workflow_disabled: ${{ steps.check-disabled.outputs.disabled }}
steps:
- name: Check if Workflow is disabled
id: check-disabled
shell: bash
run: |
if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then
echo "disabled=true" >> $GITHUB_ENV
echo "::set-output name=disabled::true"
else
echo "::set-output name=disabled::false"
fi
build-watchos-platforms:
if: needs.pre-check.outputs.workflow_disabled != 'true'
runs-on: macos-14
needs: pre-check
strategy:
matrix:
bundle: [1, 2, 3]
env:
BUNDLE: ${{ matrix.bundle }}
DEVELOPER_DIR: "/Applications/Xcode_16.2.app/Contents/Developer"
steps:
- name: Determine Release
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "RELEASE=nightly" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
echo "RELEASE=latest" >> $GITHUB_ENV
else
echo "RELEASE=latest" >> $GITHUB_ENV
fi
- uses: actions/[email protected]
- name: Scripts Calc Formula - ${{ env.TARGET }} Bundle ${{ matrix.bundle }}
run: ./scripts/calculate_formulas.sh
- name: Scripts Install
run: ./scripts/catos/install.sh
- name: Build WatchOS arm64
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: scripts/build.sh
env:
TARGET: "watchos"
BUNDLE: ${{ matrix.bundle }}
ARCH: arm64
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
- name: Build WatchOS SIM_x86_64
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: scripts/build.sh
env:
TARGET: "watchos"
BUNDLE: ${{ matrix.bundle }}
ARCH: x86_64
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
- name: Build WatchOS SIM_arm64
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: scripts/build.sh
env:
TARGET: "watchos"
BUNDLE: ${{ matrix.bundle }}
ARCH: SIM_arm64
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
- name: Package Binaries for Artifact
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: scripts/artifact/artifact.sh
env:
BUNDLE: ${{ matrix.bundle }}
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
- name: Upload binaries as Artifact
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
uses: actions/upload-artifact@v4
with:
name: libs-watchos-${{ env.TARGET }}-${{ matrix.bundle }}
path: out/openFrameworksLibs_${{ env.release }}_${{ env.TARGET }}_${{ matrix.bundle }}.tar.bz2
retention-days: 30
- name: Remove .tar.bz2 files
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
run: |
echo "Removing .tar.bz2 files from out/ directory..."
rm -f out/*.tar.bz2
echo "Cleanup complete."
- name: List output directory
run: ls -lah out/
- name: Merge our watch libaries into XC Framework
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: scripts/watchos/xcframework_all.sh
env:
TARGET: "watchos"
BUNDLE: ${{ matrix.bundle }}
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
# - name: Package
# if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding' || contains(github.ref, 'refs/tags/'))
# working-directory: ${{ env.GITHUB_WORKSPACE }}
# run: scripts/package.sh
# env:
# BUNDLE: ${{ matrix.bundle }}
# GA_CI_SECRET: ${{ secrets.CI_SECRET }}
# - name: Update Release XCFramework
# if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding' || contains(github.ref, 'refs/tags/'))
# uses: johnwbyrd/[email protected]
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# tag: ${{ env.release }}
# release: ${{ env.release }}
# prerelease: ${{ env.prerelease }}
# files: out/openFrameworksLibs_${{ env.release }}_${{ env.TARGET }}_${{ matrix.bundle }}.tar.bz2