Skip to content

Commit b9d14b7

Browse files
committed
release commit v0.4.0
1 parent 374ca18 commit b9d14b7

File tree

5 files changed

+134
-18
lines changed

5 files changed

+134
-18
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ jobs:
301301
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
302302
run: |
303303
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
304-
security create-keychain -p espressif build.keychain
304+
security list-keychains | grep -q "build.keychain" || security create-keychain -p espressif build.keychain
305305
security default-keychain -s build.keychain
306306
security unlock-keychain -p espressif build.keychain
307307
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
@@ -406,12 +406,12 @@ jobs:
406406
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
407407
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
408408
run: |
409-
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
410-
security list-keychains | grep -q "build.keychain" || security create-keychain -p espressif build.keychain
411-
security default-keychain -s build.keychain
412-
security unlock-keychain -p espressif build.keychain
413-
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
414-
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k espressif build.keychain
409+
echo $MACOS_CERTIFICATE | base64 --decode > certificate_offline.p12
410+
security create-keychain -p espressif build_offline.keychain
411+
security default-keychain -s build_offline.keychain
412+
security unlock-keychain -p espressif build_offline.keychain
413+
security import certificate_offline.p12 -k build_offline.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
414+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k espressif build_offline.keychain
415415
codesign --entitlements eim.entitlement --options runtime --force -s "ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD. (QWXF6GB4AV)" release_cli/${{ matrix.package_name }}/offline_installer_builder -v
416416
codesign -v -vvv --deep release_cli/${{ matrix.package_name }}/offline_installer_builder
417417
@@ -448,6 +448,10 @@ jobs:
448448
with:
449449
ref: ${{ github.event.pull_request.head.ref || github.ref }}
450450
run_id: ${{ github.run_id }}
451+
secrets:
452+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
453+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
454+
DL_DISTRIBUTION_ID: ${{ secrets.DL_DISTRIBUTION_ID }}
451455

452456
build-gui:
453457
name: Build GUI (${{ matrix.package_name }})
@@ -764,6 +768,7 @@ jobs:
764768
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
765769
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
766770
AWS_DEFAULT_REGION: ap-east-1
771+
DL_DISTRIBUTION_ID: ${{ secrets.DL_DISTRIBUTION_ID }}
767772
run: |
768773
# GUI release info
769774
curl -s https://api.github.com/repos/espressif/idf-im-ui/releases/latest > eim_unified_release.json

.github/workflows/build_offline_installer_archives.yaml

Lines changed: 119 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
run_id:
1010
required: true
1111
type: string
12+
secrets:
13+
AWS_ACCESS_KEY_ID:
14+
required: true
15+
AWS_SECRET_ACCESS_KEY:
16+
required: true
17+
DL_DISTRIBUTION_ID:
18+
required: true
1219

1320
workflow_dispatch:
1421
inputs:
@@ -22,6 +29,7 @@ jobs:
2229
name: Build Offline Archives (${{ matrix.package_name }})
2330
runs-on: ${{ matrix.os }}
2431
continue-on-error: true
32+
2533
strategy:
2634
fail-fast: false
2735
matrix:
@@ -112,16 +120,119 @@ jobs:
112120
path: offline_installer-${{ matrix.package_name }}-${{ env.VERSION }}.zip
113121
retention-days: 30
114122

115-
- name: Upload to release assets
116-
if: github.event_name == 'release'
117-
uses: actions/upload-release-asset@v1
123+
# Release assets are limited to 2gb, until optimisation makes the archive less than 2gigs...
124+
# - name: Upload to release assets
125+
# if: github.event_name == 'release'
126+
# uses: actions/upload-release-asset@v1
127+
# env:
128+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
# with:
130+
# upload_url: ${{ github.event.release.upload_url }}
131+
# asset_path: offline_installer-${{ matrix.package_name }}-${{ env.VERSION }}.zip
132+
# asset_name: offline_installer-${{ matrix.package_name }}-${{ env.VERSION }}.zip
133+
# asset_content_type: application/zip
134+
135+
- name: Upload installer to S3
136+
env:
137+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
138+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
139+
AWS_DEFAULT_REGION: ap-east-1
140+
VERSION: ${{ env.VERSION }}
141+
PACKAGE_NAME: ${{ matrix.package_name }}
142+
FILENAME: offline_installer-${{ matrix.package_name }}-${{ env.VERSION }}.zip
143+
shell: bash
144+
run: |
145+
# Only upload the installer ZIP
146+
aws s3 cp --acl=public-read "$FILENAME" "s3://espdldata/dl/eim/$FILENAME"
147+
148+
- name: Create build info file
118149
env:
119-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150+
VERSION: ${{ env.VERSION }}
151+
PACKAGE_NAME: ${{ matrix.package_name }}
152+
FILENAME: offline_installer-${{ matrix.package_name }}-${{ env.VERSION }}.zip
153+
shell: bash
154+
run: |
155+
# Create build info file
156+
jq -n \
157+
--arg version "$VERSION" \
158+
--arg platform "$PACKAGE_NAME" \
159+
--arg filename "$FILENAME" \
160+
'{"version": $version, "platform": $platform, "filename": $filename}' \
161+
> build-info.json
162+
163+
- name: Save build info as artifact
164+
uses: actions/upload-artifact@v4
165+
with:
166+
name: build-info-${{ matrix.package_name }}
167+
path: build-info.json
168+
169+
update-json:
170+
needs: build-offline-archives
171+
runs-on: ubuntu-latest
172+
steps:
173+
- name: Download all build info artifacts
174+
uses: actions/download-artifact@v4
120175
with:
121-
upload_url: ${{ github.event.release.upload_url }}
122-
asset_path: offline_installer-${{ matrix.package_name }}-${{ env.VERSION }}.zip
123-
asset_name: offline_installer-${{ matrix.package_name }}-${{ env.VERSION }}.zip
124-
asset_content_type: application/zip
176+
pattern: build-info-*
177+
merge-multiple: true
178+
path: build-infos/
179+
180+
- name: Update offline_archives.json
181+
env:
182+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
183+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
184+
AWS_DEFAULT_REGION: ap-east-1
185+
DL_DISTRIBUTION_ID: ${{ secrets.DL_DISTRIBUTION_ID }}
186+
VERSION: ${{ env.VERSION }}
187+
shell: bash
188+
run: |
189+
# Download existing JSON or create empty array
190+
if curl -f -s -o offline_archives.json http://dl.espressif.com/dl/eim/offline_archives.json; then
191+
echo "Downloaded existing offline_archives.json"
192+
if ! jq empty offline_archives.json 2>/dev/null; then
193+
echo "Downloaded JSON is invalid, creating new empty array"
194+
echo "[]" > offline_archives.json
195+
fi
196+
else
197+
echo "offline_archives.json does not exist, creating new empty array"
198+
echo "[]" > offline_archives.json
199+
fi
200+
201+
# Ensure valid JSON array
202+
if [ ! -s offline_archives.json ] || ! jq -e 'type == "array"' offline_archives.json >/dev/null 2>&1; then
203+
echo "File is empty or not a valid JSON array, initializing with empty array"
204+
echo "[]" > offline_archives.json
205+
fi
206+
207+
# Collect all new build info
208+
new_entries="[]"
209+
for build_info in build-infos/*.json; do
210+
if [ -f "$build_info" ]; then
211+
entry=$(cat "$build_info")
212+
new_entries=$(echo "$new_entries" | jq ". + [$entry]")
213+
fi
214+
done
215+
216+
# Remove existing entries with same filenames, then add all new entries
217+
updated_json=$(jq --argjson new_entries "$new_entries" '
218+
. as $original |
219+
($new_entries | map(.filename)) as $new_filenames |
220+
($original | map(select(.filename as $f | $new_filenames | index($f) | not))) + $new_entries
221+
' offline_archives.json)
222+
223+
echo "$updated_json" > updated_archives.json
224+
225+
# Verify the updated JSON is valid
226+
if ! jq empty updated_archives.json 2>/dev/null; then
227+
echo "Error: Generated JSON is invalid"
228+
exit 1
229+
fi
230+
231+
# Upload updated JSON to S3
232+
aws s3 cp --acl=public-read updated_archives.json s3://espdldata/dl/eim/offline_archives.json
233+
234+
# Invalidate Cache
235+
aws cloudfront create-invalidation --distribution-id ${DL_DISTRIBUTION_ID} --paths "/dl/eim/offline_archives.json"
125236
126237
Autotest-CLI-Offline:
127238
needs: [build-offline-archives]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eim",
33
"private": true,
4-
"version": "0.3.0",
4+
"version": "0.4.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "eim"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
description = "ESP-IDF Installation Manager"
55
authors = ["[email protected]"]
66
edition = "2021"

0 commit comments

Comments
 (0)