Skip to content

Commit 595ee10

Browse files
committed
unifing build pipeline
1 parent da390b9 commit 595ee10

File tree

2 files changed

+213
-14
lines changed

2 files changed

+213
-14
lines changed

.github/workflows/build.yaml

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
name: Unified Build
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
branches:
8+
- master
9+
pull_request:
10+
branches:
11+
- master
12+
release:
13+
types:
14+
- created
15+
workflow_dispatch:
16+
17+
jobs:
18+
setup-matrix:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
matrix: ${{ steps.set-matrix.outputs.matrix }}
22+
steps:
23+
- id: set-matrix
24+
run: |
25+
echo "matrix={\
26+
\"include\":[\
27+
{\"os\":\"ubuntu-latest\",\"package_name\":\"linux-x64\"},\
28+
{\"os\":\"ubuntu-24.04-arm\",\"target\":\"aarch64-unknown-linux-gnu\",\"package_name\":\"linux-arm64\"},\
29+
{\"os\":\"windows-latest\",\"package_name\":\"windows-x64\"},\
30+
{\"os\":\"macos-latest\",\"package_name\":\"macos-aarch64\"},\
31+
{\"os\":\"macos-13\",\"package_name\":\"macos-x64\"}\
32+
]}" >> "$GITHUB_OUTPUT"
33+
34+
build:
35+
needs: setup-matrix
36+
name: Build
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
matrix: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
40+
fail-fast: false
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v4
45+
46+
- name: Setup Rust
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
toolchain: stable
50+
override: true
51+
target: ${{ matrix.target }}
52+
53+
# Common setup steps for all platforms
54+
- name: Install OpenSSL (Windows)
55+
if: runner.os == 'Windows'
56+
shell: powershell
57+
run: |
58+
echo "OPENSSL_DIR=$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows-static" | Out-File -FilePath $env:GITHUB_ENV -Append
59+
echo "OPENSSL_STATIC=1" | Out-File -FilePath $env:GITHUB_ENV -Append
60+
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
61+
vcpkg install openssl:x64-windows-static
62+
63+
- name: Install OpenSSL (MacOS)
64+
if: matrix.os == 'macos-latest'
65+
run: brew install openssl
66+
67+
# Build & testLibrary
68+
- name: Build and Test Library
69+
run: |
70+
cd src-tauri
71+
if [ "${{ matrix.target }}" != "" ]; then
72+
cargo test --no-fail-fast --no-default-features --lib --target ${{ matrix.target }} 2>&1 | tee result_lib.txt
73+
else
74+
cargo test --no-fail-fast --no-default-features --lib 2>&1 | tee result_lib.txt
75+
fi
76+
shell: bash
77+
continue-on-error: true
78+
79+
- name: Format test results
80+
uses: hahihula/rust-test-results-formatter@v1
81+
with:
82+
results-file: "./src-tauri/result_lib.txt"
83+
84+
# Build CLI
85+
- name: Build CLI
86+
run: |
87+
cd src-tauri
88+
if [ "${{ matrix.target }}" != "" ]; then
89+
cargo build --release --no-default-features --features cli --target ${{ matrix.target }}
90+
else
91+
cargo build --release --no-default-features --features cli
92+
fi
93+
shell: bash
94+
95+
# Build GUI (Tauri)
96+
- name: Setup Node
97+
uses: actions/setup-node@v4
98+
with:
99+
node-version: lts/*
100+
101+
- name: Install frontend dependencies
102+
run: yarn install
103+
104+
# Platform specific GUI dependencies
105+
- name: Install GUI dependencies (Ubuntu)
106+
if: runner.os == 'Linux'
107+
run: |
108+
sudo apt-get update
109+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libssl-dev patchelf
110+
111+
# Signing and notarization steps
112+
- uses: apple-actions/import-codesign-certs@v3
113+
if: startsWith(matrix.os, 'macos')
114+
with:
115+
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
116+
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}
117+
keychain: build
118+
119+
- name: build with signing and notarization (macos only)
120+
if: startsWith(matrix.os, 'macos')
121+
env:
122+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
123+
APPLE_ID: ${{ secrets.NOTARIZATION_USERNAME }}
124+
APPLE_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
125+
APPLE_TEAM_ID: ${{ secrets.NOTARIZATION_TEAM_ID }}
126+
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
127+
run: |
128+
/usr/bin/security create-keychain -p espressif notary.keychain
129+
/usr/bin/security default-keychain -s notary.keychain
130+
/usr/bin/security unlock-keychain -p espressif notary.keychain
131+
yarn tauri build
132+
133+
134+
- name: build app
135+
if: ${{ ! startsWith(matrix.os, 'macos') }}
136+
run: |
137+
yarn tauri build
138+
139+
- name: Sign Windows binaries
140+
if: runner.os == 'Windows'
141+
env:
142+
WINDOWS_PFX_FILE: ${{ secrets.WIN_CERTIFICATE }}
143+
WINDOWS_PFX_PASSWORD: ${{ secrets.WIN_CERTIFICATE_PWD }}
144+
WINDOWS_SIGN_TOOL_PATH: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool.exe'
145+
run: |
146+
echo $env:WINDOWS_PFX_FILE | Out-File -FilePath cert.b64 -Encoding ASCII
147+
certutil -decode cert.b64 cert.pfx
148+
Remove-Item cert.b64
149+
& "$env:WINDOWS_SIGN_TOOL_PATH" sign /f cert.pfx /p $env:WINDOWS_PFX_PASSWORD /tr http://timestamp.digicert.com /td sha256 /fd sha256 src-tauri/target/release/eim.exe
150+
151+
# Package and upload artifacts
152+
- name: Package artifacts
153+
run: |
154+
mkdir -p release/{cli,lib,gui}
155+
# Copy and zip CLI artifacts
156+
cp src-tauri/target/release/eim* release/cli/
157+
cd release/cli && zip -r eim-cli.zip . && cd ../..
158+
# Copy and zip GUI artifacts
159+
cp -r src-tauri/target/release/bundle/* release/gui/
160+
cd release/gui && zip -r eim-gui.zip . && cd ../..
161+
162+
- name: Upload artifacts
163+
uses: actions/upload-artifact@v4
164+
with:
165+
name: eim-${{ matrix.package_name }}-${{ github.run_number }}
166+
path: |
167+
release/cli/eim-cli.zip
168+
release/gui/eim-gui.zip
169+
170+
- name: Upload Release Assets
171+
if: github.event_name == 'release' && github.event.action == 'created'
172+
uses: actions/upload-release-asset@v1
173+
env:
174+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175+
with:
176+
upload_url: ${{ github.event.release.upload_url }}
177+
asset_path: release/cli/eim-cli.zip
178+
asset_name: eim-cli-${{ matrix.package_name }}-${{ github.ref_name }}.zip
179+
asset_content_type: application/zip
180+
181+
# Tests can run in parallel after build
182+
test:
183+
needs: build
184+
uses: ./.github/workflows/test.yml
185+
with:
186+
run_id: ${{ github.run_number }}
187+
ref: ${{ github.event.pull_request.head.ref }}
188+
189+
test-cli:
190+
needs: build
191+
uses: ./.github/workflows/test_cli.yml
192+
with:
193+
run_id: ${{ github.run_number }}
194+
ref: ${{ github.event.pull_request.head.ref }}
195+
196+
update-release-info:
197+
needs: [build, test, test-cli]
198+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
199+
runs-on: ubuntu-latest
200+
steps:
201+
- name: Update release information
202+
env:
203+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
204+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
205+
AWS_DEFAULT_REGION: ap-east-1
206+
run: |
207+
# Update CLI release info
208+
curl -s https://api.github.com/repos/espressif/idf-im-cli/releases/latest > eim_cli_release.json
209+
aws s3 cp --acl=public-read "eim_cli_release.json" s3://espdldata/dl/eim/eim_cli_release.json
210+
211+
# Update GUI release info
212+
curl -s https://api.github.com/repos/espressif/idf-im-ui/releases/latest > eim_gui_release.json
213+
aws s3 cp --acl=public-read "eim_gui_release.json" s3://espdldata/dl/eim/eim_gui_release.json

tests_cli/runs/suites/basic-test.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,5 @@
1616
"data": {
1717
"nonInteractive": "true"
1818
}
19-
},
20-
{
21-
"id": 4,
22-
"type": "custom",
23-
"name": "non-interactive-full-parameters",
24-
"data": {
25-
"targetList": "esp32s2",
26-
"idfList": "v5.3.2",
27-
"installFolder": ".espcustom",
28-
"idfMirror": "github",
29-
"toolsMirror": "github",
30-
"recursive": "false",
31-
"nonInteractive": "false"
32-
}
3319
}
3420
]

0 commit comments

Comments
 (0)