Skip to content

Commit a5756fe

Browse files
Initial release
0 parents  commit a5756fe

18 files changed

Lines changed: 10035 additions & 0 deletions

.github/workflows/build.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
package:
13+
name: Package on ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os:
19+
- windows-latest
20+
- macos-latest
21+
- ubuntu-latest
22+
23+
steps:
24+
- name: Check out repository
25+
uses: actions/checkout@v6
26+
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v6
29+
with:
30+
node-version: 22
31+
cache: npm
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Run checks
37+
run: npm run check
38+
39+
- name: Package app
40+
run: npm run package
41+
42+
- name: Create Windows ZIP
43+
if: runner.os == 'Windows'
44+
shell: pwsh
45+
run: |
46+
New-Item -ItemType Directory -Force release | Out-Null
47+
$packageDir = Get-ChildItem -Path out -Directory | Select-Object -First 1
48+
if (-not $packageDir) {
49+
throw 'No packaged app directory found in out/.'
50+
}
51+
Compress-Archive -Path (Join-Path $packageDir.FullName '*') -DestinationPath release/easyeda2kicad-gui-windows-x64.zip -Force
52+
53+
- name: Create macOS ZIP
54+
if: runner.os == 'macOS'
55+
shell: bash
56+
run: |
57+
set -euo pipefail
58+
mkdir -p release
59+
package_dir="$(find out -maxdepth 1 -mindepth 1 -type d | head -n 1)"
60+
app_bundle="$(find "$package_dir" -maxdepth 1 -name '*.app' -type d | head -n 1)"
61+
if [ -z "$app_bundle" ]; then
62+
echo "No .app bundle found in $package_dir" >&2
63+
exit 1
64+
fi
65+
ditto -c -k --sequesterRsrc --keepParent "$app_bundle" release/easyeda2kicad-gui-macos-x64.zip
66+
67+
- name: Create Linux ZIP
68+
if: runner.os == 'Linux'
69+
shell: bash
70+
run: |
71+
set -euo pipefail
72+
mkdir -p release
73+
package_dir="$(find out -maxdepth 1 -mindepth 1 -type d | head -n 1)"
74+
if [ -z "$package_dir" ]; then
75+
echo "No packaged app directory found in out/." >&2
76+
exit 1
77+
fi
78+
(cd "$package_dir" && zip -r "../../release/easyeda2kicad-gui-linux-x64.zip" .)
79+
80+
- name: Upload packaged ZIP
81+
uses: actions/upload-artifact@v6
82+
with:
83+
name: easyeda2kicad-gui-${{ runner.os }}-x64
84+
path: release/*.zip
85+
if-no-files-found: error
86+
87+
release:
88+
name: Publish GitHub Release
89+
needs: package
90+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
91+
runs-on: ubuntu-latest
92+
permissions:
93+
actions: read
94+
contents: write
95+
96+
steps:
97+
- name: Download packaged ZIPs
98+
uses: actions/download-artifact@v7
99+
with:
100+
path: release-assets
101+
merge-multiple: true
102+
103+
- name: Publish release assets
104+
env:
105+
GH_TOKEN: ${{ github.token }}
106+
run: |
107+
set -euo pipefail
108+
ls -la release-assets
109+
if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
110+
gh release upload "$GITHUB_REF_NAME" release-assets/*.zip --repo "$GITHUB_REPOSITORY" --clobber
111+
else
112+
gh release create "$GITHUB_REF_NAME" release-assets/*.zip --repo "$GITHUB_REPOSITORY" --title "EasyEDA2KiCad GUI $GITHUB_REF_NAME" --generate-notes
113+
fi

.gitignore

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
.DS_Store
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# TypeScript cache
43+
*.tsbuildinfo
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
.env.test
63+
64+
# Build caches
65+
.cache
66+
.next
67+
.nuxt
68+
.vuepress/dist
69+
.serverless/
70+
.fusebox/
71+
.dynamodb/
72+
.webpack/
73+
.vite/
74+
75+
# Electron Forge
76+
out/
77+
78+
# Local backup/build scratch directories
79+
backup/

0 commit comments

Comments
 (0)