Skip to content

Commit e067652

Browse files
committed
Add release electron build
1 parent ab81d01 commit e067652

File tree

5 files changed

+78
-10
lines changed

5 files changed

+78
-10
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build Capacitor Release
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
target: [android]
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: "17"
20+
distribution: "temurin"
21+
22+
- name: Setup Android SDK
23+
uses: android-actions/setup-android@v3
24+
25+
- name: Install Android SDK build tools
26+
run: |
27+
sdkmanager "build-tools;34.0.0"
28+
echo "$ANDROID_SDK_ROOT/build-tools/34.0.0" >> $GITHUB_PATH"
29+
30+
- name: Try apksigner
31+
run: apksigner --version
32+
33+
- name: Get Keystore
34+
run: |
35+
echo ${{ secrets.ANDROID_KEYSTORE }} | base64 --decode > keystore.jks
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 22.x
41+
42+
- name: Install dependencies
43+
run: npm install
44+
45+
- name: Build Web App
46+
run: npm run build
47+
48+
- name: Change Android Project Permission
49+
run: chmod +x android/gradlew
50+
51+
- name: Build Capacitor App
52+
run: |
53+
npx cap sync
54+
npx cap build android --keystorepath keystore.jks --keystorepass ${{ secrets.ANDROID_KEYSTORE_PASS }} --androidreleasetype APK
55+
56+
# - name: Create Release Build
57+
# uses: softprops/action-gh-release@v2
58+
# with:
59+
# files: |
60+
# android.zip
61+
# ios.zip
62+
# env:
63+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-electron.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ jobs:
2424
- name: Install dependencies
2525
run: npm install
2626

27-
- name: Build Web App
28-
run: |
29-
npm run build
30-
3127
- name: Build Electron App
3228
run: |
3329
npm run desktop-build

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@ certificates
4343

4444
# capacitor
4545
resources/android/**/*
46+
47+
.keystore
48+
# act cli secrets for testing github actions locally
49+
*.secrets

capacitor.config.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
import type { CapacitorConfig } from '@capacitor/cli';
1+
import type { CapacitorConfig } from "@capacitor/cli";
22

33
const config: CapacitorConfig = {
4-
appId: 'com.chisel.app',
5-
appName: 'Chisel Editor',
6-
webDir: 'out-next'
4+
appId: "com.chisel.app",
5+
appName: "Chisel Editor",
6+
webDir: "out-next",
7+
android: {
8+
buildOptions: {
9+
signingType: "apksigner",
10+
},
11+
},
712
};
813

914
export default config;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"lint": "next lint",
1212
"android": "next build && npx cap sync && npx cap run android",
1313
"desktop-dev": "electron .",
14-
"desktop-build": "electron-forge package"
14+
"desktop-build": "next build && electron-forge package"
1515
},
1616
"dependencies": {
1717
"@capacitor/android": "^6.2.0",
@@ -59,4 +59,4 @@
5959
"tailwindcss": "^3.4.1",
6060
"typescript": "^5"
6161
}
62-
}
62+
}

0 commit comments

Comments
 (0)