Skip to content

Commit 7ec73cf

Browse files
authored
Update main.yml
1 parent ff0adb3 commit 7ec73cf

File tree

1 file changed

+151
-117
lines changed

1 file changed

+151
-117
lines changed

.github/workflows/main.yml

Lines changed: 151 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -35,94 +35,94 @@ jobs:
3535
with:
3636
submodules: recursive
3737

38-
- name: '❖ Install Windows Certificates (1/3)'
39-
if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
40-
env:
41-
SM_CLIENT_CERT_FILE_B64: ${{ secrets.SM_CLIENT_CERT_FILE_B64 }}
42-
run: |
43-
CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12
44-
echo "$SM_CLIENT_CERT_FILE_B64" | base64 --decode > $CERTIFICATE_PATH
45-
echo "SM_CLIENT_CERT_FILE=$CERTIFICATE_PATH" >> "$GITHUB_ENV"
46-
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
47-
echo "C:\Program Files\DigiCert\DigiCert One Signing Manager Tools" >> $GITHUB_PATH
48-
shell: bash
49-
50-
- name: '❖ Install Windows Certificates (2/3)'
51-
if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
52-
uses: digicert/[email protected]
53-
54-
- name: '❖ Install Windows Certificates (3/3)'
55-
if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
56-
env:
57-
SM_API_KEY: ${{ secrets.SM_API_KEY }}
58-
run: smctl windows certsync --keypair-alias=$SM_API_KEY
59-
60-
- name: '🍏 Install Apple Certificates'
61-
if: matrix.map.host == 'mac'
62-
env:
63-
APPLICATION_CERTIFICATE_BASE64: ${{ secrets.MAC_APPLICATION_CER }}
64-
APPLICATION_P12_PASSWORD: ${{ secrets.MAC_APPLICATION_CER_PASSWORD }}
65-
INSTALLER_CERTIFICATE_BASE64: ${{ secrets.MAC_INSTALLER_CER }}
66-
INSTALLER_P12_PASSWORD: ${{ secrets.MAC_INSTALLER_CER_PASSWORD }}
67-
KEYCHAIN_PASSWORD: ${{ secrets.MAC_KEYCHAIN_PASSWORD }}
68-
APPLE_ID: ${{ secrets.MAC_APPLE_ID }}
69-
TEAM_ID: ${{ secrets.MAC_TEAM_ID }}
70-
NOTARYTOOL_PASSWORD: ${{ secrets.MAC_2FA_PASSWORD }}
71-
run: |
72-
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
73-
APPLICATION_CERTIFICATE_PATH=$RUNNER_TEMP/application_certificate.p12
74-
INSTALLER_CERTIFICATE_PATH=$RUNNER_TEMP/installer_certificate.p12
75-
echo -n "$APPLICATION_CERTIFICATE_BASE64" | base64 --decode -o $APPLICATION_CERTIFICATE_PATH
76-
echo -n "$INSTALLER_CERTIFICATE_BASE64" | base64 --decode -o $INSTALLER_CERTIFICATE_PATH
77-
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
78-
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
79-
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
80-
security import $APPLICATION_CERTIFICATE_PATH -P "$APPLICATION_P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
81-
security import $INSTALLER_CERTIFICATE_PATH -P "$INSTALLER_P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
82-
security list-keychain -d user -s $KEYCHAIN_PATH
83-
xcrun notarytool store-credentials "AC_PASSWORD" --apple-id "$APPLE_ID" --team-id "$TEAM_ID" --password "$NOTARYTOOL_PASSWORD"
84-
85-
- name: '⬇ Install Qt on Windows'
86-
if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
87-
uses: jurplel/install-qt-action@v3
88-
with:
89-
aqtversion: '==3.1.*'
90-
version: '6.5.1'
91-
host: 'windows'
92-
target: 'desktop'
93-
arch: 'win64_mingw'
94-
dir: 'C:\Users\runneradmin'
95-
modules: 'qtimageformats qtserialport qt5compat'
96-
cache: true
97-
tools: 'tools_cmake tools_ifw tools_ninja tools_mingw90'
98-
99-
- name: '⬇ Install Qt on Linux'
100-
if: matrix.map.host == 'linux'
101-
uses: jurplel/install-qt-action@v3
102-
with:
103-
aqtversion: '==3.1.*'
104-
version: '6.5.1'
105-
host: 'linux'
106-
target: 'desktop'
107-
arch: 'gcc_64'
108-
dir: '/home/runner'
109-
modules: 'qtimageformats qtserialport qt5compat'
110-
cache: true
111-
tools: 'tools_cmake tools_ifw tools_ninja'
112-
113-
- name: '⬇ Install Qt on Mac'
114-
if: matrix.map.host == 'mac'
115-
uses: jurplel/install-qt-action@v3
116-
with:
117-
aqtversion: '==3.1.*'
118-
version: '6.5.1'
119-
host: 'mac'
120-
target: 'desktop'
121-
arch: 'clang_64'
122-
dir: '/Users/runner'
123-
modules: 'qtimageformats qtserialport qt5compat'
124-
cache: true
125-
tools: 'tools_cmake tools_ninja'
38+
# - name: '❖ Install Windows Certificates (1/3)'
39+
# if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
40+
# env:
41+
# SM_CLIENT_CERT_FILE_B64: ${{ secrets.SM_CLIENT_CERT_FILE_B64 }}
42+
# run: |
43+
# CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12
44+
# echo "$SM_CLIENT_CERT_FILE_B64" | base64 --decode > $CERTIFICATE_PATH
45+
# echo "SM_CLIENT_CERT_FILE=$CERTIFICATE_PATH" >> "$GITHUB_ENV"
46+
# echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
47+
# echo "C:\Program Files\DigiCert\DigiCert One Signing Manager Tools" >> $GITHUB_PATH
48+
# shell: bash
49+
50+
# - name: '❖ Install Windows Certificates (2/3)'
51+
# if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
52+
# uses: digicert/[email protected]
53+
54+
# - name: '❖ Install Windows Certificates (3/3)'
55+
# if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
56+
# env:
57+
# SM_API_KEY: ${{ secrets.SM_API_KEY }}
58+
# run: smctl windows certsync --keypair-alias=$SM_API_KEY
59+
60+
# - name: '🍏 Install Apple Certificates'
61+
# if: matrix.map.host == 'mac'
62+
# env:
63+
# APPLICATION_CERTIFICATE_BASE64: ${{ secrets.MAC_APPLICATION_CER }}
64+
# APPLICATION_P12_PASSWORD: ${{ secrets.MAC_APPLICATION_CER_PASSWORD }}
65+
# INSTALLER_CERTIFICATE_BASE64: ${{ secrets.MAC_INSTALLER_CER }}
66+
# INSTALLER_P12_PASSWORD: ${{ secrets.MAC_INSTALLER_CER_PASSWORD }}
67+
# KEYCHAIN_PASSWORD: ${{ secrets.MAC_KEYCHAIN_PASSWORD }}
68+
# APPLE_ID: ${{ secrets.MAC_APPLE_ID }}
69+
# TEAM_ID: ${{ secrets.MAC_TEAM_ID }}
70+
# NOTARYTOOL_PASSWORD: ${{ secrets.MAC_2FA_PASSWORD }}
71+
# run: |
72+
# KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
73+
# APPLICATION_CERTIFICATE_PATH=$RUNNER_TEMP/application_certificate.p12
74+
# INSTALLER_CERTIFICATE_PATH=$RUNNER_TEMP/installer_certificate.p12
75+
# echo -n "$APPLICATION_CERTIFICATE_BASE64" | base64 --decode -o $APPLICATION_CERTIFICATE_PATH
76+
# echo -n "$INSTALLER_CERTIFICATE_BASE64" | base64 --decode -o $INSTALLER_CERTIFICATE_PATH
77+
# security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
78+
# security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
79+
# security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
80+
# security import $APPLICATION_CERTIFICATE_PATH -P "$APPLICATION_P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
81+
# security import $INSTALLER_CERTIFICATE_PATH -P "$INSTALLER_P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
82+
# security list-keychain -d user -s $KEYCHAIN_PATH
83+
# xcrun notarytool store-credentials "AC_PASSWORD" --apple-id "$APPLE_ID" --team-id "$TEAM_ID" --password "$NOTARYTOOL_PASSWORD"
84+
85+
# - name: '⬇ Install Qt on Windows'
86+
# if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
87+
# uses: jurplel/install-qt-action@v3
88+
# with:
89+
# aqtversion: '==3.1.*'
90+
# version: '6.5.1'
91+
# host: 'windows'
92+
# target: 'desktop'
93+
# arch: 'win64_mingw'
94+
# dir: 'C:\Users\runneradmin'
95+
# modules: 'qtimageformats qtserialport qt5compat'
96+
# cache: true
97+
# tools: 'tools_cmake tools_ifw tools_ninja tools_mingw90'
98+
99+
# - name: '⬇ Install Qt on Linux'
100+
# if: matrix.map.host == 'linux'
101+
# uses: jurplel/install-qt-action@v3
102+
# with:
103+
# aqtversion: '==3.1.*'
104+
# version: '6.5.1'
105+
# host: 'linux'
106+
# target: 'desktop'
107+
# arch: 'gcc_64'
108+
# dir: '/home/runner'
109+
# modules: 'qtimageformats qtserialport qt5compat'
110+
# cache: true
111+
# tools: 'tools_cmake tools_ifw tools_ninja'
112+
113+
# - name: '⬇ Install Qt on Mac'
114+
# if: matrix.map.host == 'mac'
115+
# uses: jurplel/install-qt-action@v3
116+
# with:
117+
# aqtversion: '==3.1.*'
118+
# version: '6.5.1'
119+
# host: 'mac'
120+
# target: 'desktop'
121+
# arch: 'clang_64'
122+
# dir: '/Users/runner'
123+
# modules: 'qtimageformats qtserialport qt5compat'
124+
# cache: true
125+
# tools: 'tools_cmake tools_ninja'
126126

127127
- name: '⬇ Install Qt Cross-Compile for Raspberry Pi'
128128
if: matrix.map.host == 'linux-rpi'
@@ -187,7 +187,10 @@ jobs:
187187
SM_API_KEY: ${{ secrets.SM_API_KEY }}
188188
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
189189
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
190-
run: python make.py
190+
# run: python make.py
191+
run: |
192+
mkdir build
193+
echo "Test" > build/openmv-ide-test.${{matrix.map.suffix}}
191194
192195
- name: '🏗 Build IDE on Windows'
193196
if: matrix.map.host == 'windows' && matrix.map.suffix == 'zip'
@@ -196,7 +199,10 @@ jobs:
196199
SM_API_KEY: ${{ secrets.SM_API_KEY }}
197200
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
198201
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
199-
run: python make.py --no-build-installer
202+
# run: python make.py --no-build-installer
203+
run: |
204+
mkdir build
205+
echo "Test" > build/openmv-ide-test.${{matrix.map.suffix}}
200206
201207
- name: '🏗 Build IDE on Windows'
202208
if: matrix.map.host == 'windows-factory' && matrix.map.suffix == 'exe'
@@ -205,7 +211,10 @@ jobs:
205211
SM_API_KEY: ${{ secrets.SM_API_KEY }}
206212
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
207213
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
208-
run: python make.py --factory
214+
# run: python make.py --factory
215+
run: |
216+
mkdir build
217+
echo "Test" > build/openmv-ide-factory-test.${{matrix.map.suffix}}
209218
210219
- name: '🏗 Build IDE on Windows'
211220
if: matrix.map.host == 'windows-factory' && matrix.map.suffix == 'zip'
@@ -214,30 +223,43 @@ jobs:
214223
SM_API_KEY: ${{ secrets.SM_API_KEY }}
215224
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
216225
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
217-
run: python make.py --factory --no-build-installer
226+
# run: python make.py --factory --no-build-installer
227+
run: |
228+
mkdir build
229+
echo "Test" > build/openmv-ide-factory-test.${{matrix.map.suffix}}
218230
219231
- name: '🏗 Build IDE on Linux .run'
220232
if: matrix.map.host == 'linux' && matrix.map.suffix == 'run'
221233
env:
222234
MAKE_ARGS: ${{ matrix.map.make_args }}
235+
# run: |
236+
# sudo apt-get install -y chrpath
237+
# python make.py
238+
# version=$(ls build | grep -oP 'openmv-ide-linux-x86_64-\K[0-9]+\.[0-9]+\.[0-9]+(?=\.run)')
239+
# cd qt-creator/share/qtcreator
240+
# zip -r ../../../build/openmv-ide-resources-${version}.zip examples firmware html models
223241
run: |
224-
sudo apt-get install -y chrpath
225-
python make.py
226-
version=$(ls build | grep -oP 'openmv-ide-linux-x86_64-\K[0-9]+\.[0-9]+\.[0-9]+(?=\.run)')
227-
cd qt-creator/share/qtcreator
228-
zip -r ../../../build/openmv-ide-resources-${version}.zip examples firmware html models
242+
mkdir build
243+
echo "Test" > build/openmv-ide-test.${{matrix.map.suffix}}
244+
echo "Test" > build/openmv-ide-resources.zip
229245
230246
- name: '🏗 Build IDE on Linux .tar.gz'
231247
if: matrix.map.host == 'linux' && matrix.map.suffix == 'tar.gz'
232248
env:
233249
MAKE_ARGS: ${{ matrix.map.make_args }}
250+
# run: |
251+
# sudo apt-get install -y chrpath
252+
# python make.py --no-build-installer
234253
run: |
235-
sudo apt-get install -y chrpath
236-
python make.py --no-build-installer
254+
mkdir build
255+
echo "Test" > build/openmv-ide-test.${{matrix.map.suffix}}
237256
238257
- name: '🏗 Build IDE on Mac'
239258
if: matrix.map.host == 'mac'
240-
run: python make.py
259+
# run: python make.py
260+
run: |
261+
mkdir build
262+
echo "Test" > build/openmv-ide-test.${{matrix.map.suffix}}
241263
242264
- name: '🏗 Build IDE on Linux for Raspberry Pi'
243265
if: matrix.map.host == 'linux-rpi'
@@ -259,14 +281,14 @@ jobs:
259281
path: 'build/openmv-*.zip'
260282
if-no-files-found: error
261283

262-
- name: '❖ Remove Windows Certificates'
263-
if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
264-
run: rm $SM_CLIENT_CERT_FILE
265-
shell: bash
284+
# - name: '❖ Remove Windows Certificates'
285+
# if: matrix.map.host == 'windows' || matrix.map.host == 'windows-factory'
286+
# run: rm $SM_CLIENT_CERT_FILE
287+
# shell: bash
266288

267-
- name: '🍏 Remove Apple Certificates'
268-
if: matrix.map.host == 'mac'
269-
run: security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
289+
# - name: '🍏 Remove Apple Certificates'
290+
# if: matrix.map.host == 'mac'
291+
# run: security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
270292

271293
stable-release:
272294
needs: build
@@ -298,18 +320,24 @@ jobs:
298320
- name: '📥 Download and upload each artifact separately'
299321
env:
300322
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
323+
ACTIONS_STEP_DEBUG: true
301324
run: |
302325
for EXT in zip tar.gz run exe dmg; do
303-
gh run download -p artifact-*-$EXT
326+
gh run download --run-id ${{ github.run_id }} -p artifact-*-$EXT
304327
gh release upload ${{ github.ref_name }} artifact-*-$EXT/* --clobber
305328
rm -rf artifact-*-$EXT
306329
done
307330
308331
- name: '🧹 Remove artifacts'
309-
uses: geekyeggo/delete-artifact@v5
310-
with:
311-
name: '*'
312-
failOnError: false
332+
env:
333+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
334+
ACTIONS_STEP_DEBUG: true
335+
run: |
336+
artifacts=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[].name')
337+
for name in $artifacts; do
338+
echo "Deleting artifact: $name"
339+
gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq ".artifacts[] | select(.name==\"$name\") | .id")
340+
done
313341
314342
development-release:
315343
needs: build
@@ -355,15 +383,21 @@ jobs:
355383
- name: '📥 Download and upload each artifact separately'
356384
env:
357385
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
386+
ACTIONS_STEP_DEBUG: true
358387
run: |
359388
for EXT in zip tar.gz run exe dmg; do
360-
gh run download -p artifact-*-$EXT
389+
gh run download --run-id ${{ github.run_id }} -p artifact-*-$EXT
361390
gh release upload development artifact-*-$EXT/* --clobber
362391
rm -rf artifact-*-$EXT
363392
done
364393
365394
- name: '🧹 Remove artifacts'
366-
uses: geekyeggo/delete-artifact@v5
367-
with:
368-
name: '*'
369-
failOnError: false
395+
env:
396+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
397+
ACTIONS_STEP_DEBUG: true
398+
run: |
399+
artifacts=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[].name')
400+
for name in $artifacts; do
401+
echo "Deleting artifact: $name"
402+
gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq ".artifacts[] | select(.name==\"$name\") | .id")
403+
done

0 commit comments

Comments
 (0)