-
Notifications
You must be signed in to change notification settings - Fork 79
159 lines (150 loc) · 5.95 KB
/
build-macos.yml
File metadata and controls
159 lines (150 loc) · 5.95 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: build-macos
on:
push:
paths-ignore:
- '**/README.md'
pull_request:
paths-ignore:
- '**/README.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ccache: ccache
jobs:
build-macos:
runs-on: macos-latest
strategy:
matrix:
cfg:
- { target: osx }
env:
TARGET: ${{ matrix.cfg.target }}
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.14
with:
# key: ${{ matrix.os }}-${{ matrix.type }}
key: ${{ matrix.os }}-${{ matrix.cfg.target }}
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Setup
run: ./scripts/osx/setup_environment.sh
- name: Determine Release
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
echo "PRERELEASE=false" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "RELEASE=nightly" >> $GITHUB_ENV
echo "PRERELEASE=false" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
echo "RELEASE=bleeding" >> $GITHUB_ENV
echo "PRERELEASE=true" >> $GITHUB_ENV
else
echo "RELEASE=bleeding" >> $GITHUB_ENV
echo "PRERELEASE=true" >> $GITHUB_ENV
fi
- name: PWD and LS
run: |
echo "Current directory: (should be projectGenerator)"
pwd
echo "Directory contents:"
ls
- name: Setup CI setup environment / checkout oF
run: |
./scripts/osx/ci_install_core.sh
- name: List Repository Structure
run: |
echo "GITHUB_WORKSPACE is: $GITHUB_WORKSPACE"
ls -lah $GITHUB_WORKSPACE
- name: build_cmdline.sh
run: |
echo "Current directory: $(pwd)"
echo "Listing repository root:"
ls -lah ..
echo "Changing directory to openFrameworks..."
cd ../openFrameworks
echo "Now in: $(pwd)"
echo "Listing apps/projectGenerator/:"
ls -lah apps/projectGenerator/
echo "Executing build_cmdline.sh:"
./apps/projectGenerator/scripts/osx/build_cmdline.sh
- name: Build PG macOS GUI and command line
run: |
# Move up one level to projectGenerator directory
cd ../
if [ -f "openFrameworks/apps/projectGenerator/scripts/osx/ci_build_pg.sh" ]; then
echo "ci_build_pg.sh exists, running script..."
openFrameworks/apps/projectGenerator/scripts/osx/ci_build_pg.sh
else
echo "ci_build_pg.sh does not exist, checking Git status..."
if cd openFrameworks/apps/projectGenerator; then
echo "Current Git branch in projectGenerator:"
git rev-parse --abbrev-ref HEAD
echo "Latest commit hash in projectGenerator:"
git rev-parse HEAD
else
echo "Failed to change directory to openFrameworks/apps/projectGenerator"
fi
echo "Current directory: (should be openFrameworks/apps/projectGenerator)"
pwd
echo "Directory contents:"
ls
echo "------------------"
echo "Failure exit1"
exit 1
fi
env:
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
GA_APPLE_USERNAME: ${{ secrets.GA_APPLE_USERNAME }}
GA_APPLE_PASS: ${{ secrets.GA_APPLE_PASS }}
GA_NOTARIZE_PROVIDER: ${{ secrets.GA_NOTARIZE_PROVIDER }}
- name: Check output
run: |
echo "Current directory: (should be projectGenerator)"
pwd
echo "Directory contents:"
ls
if [ -f "projectGenerator/projectGenerator-osx.zip" ]; then
echo "projectGenerator/projectGenerator-osx.zip found at level 1"
else
echo "projectGenerator/projectGenerator-osx.zip NOT found at level 1"
fi
if [ -f "projectGenerator/projectGenerator/projectGenerator-osx.zip" ]; then
echo "projectGenerator/projectGenerator/projectGenerator-osx.zip found at level 2"
else
echo "projectGenerator/projectGenerator/projectGenerator-osx.zip NOT found at level 2"
fi
if [ -f "projectGenerator-osx.zip" ]; then
echo "projectGenerator-osx.zip found at level 0"
else
echo "projectGenerator-osx.zip NOT found at level 0"
fi
if [ -f "projectGenerator-osx-arm64.zip" ]; then
echo "projectGenerator-osx-arm64.zip found at level 0"
else
echo "projectGenerator-osx-arm64.zip NOT found at level 0"
fi
- name: Test cmdline
run: ../openFrameworks/apps/projectGenerator/scripts/osx/test_cmdline.sh
- name: Update Release macOS-arm64
if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
uses: softprops/action-gh-release@v2.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.RELEASE }}
files: projectGenerator-mac-arm64.zip
- name: Update Release macOS
if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
uses: softprops/action-gh-release@v2.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.RELEASE }}
files: projectGenerator-osx.zip