Skip to content

Commit 3befe6a

Browse files
committed
first
0 parents  commit 3befe6a

110 files changed

Lines changed: 20580 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/bundle-app.yml‎

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
name: Bundle App
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
app_path:
7+
description: 'Path to app directory (relative to repo root)'
8+
required: true
9+
default: 'apps/example-deno-app'
10+
sign_windows:
11+
description: 'Sign Windows MSIX package'
12+
required: false
13+
default: 'false'
14+
type: boolean
15+
sign_macos:
16+
description: 'Sign and notarize macOS app'
17+
required: false
18+
default: 'false'
19+
type: boolean
20+
21+
env:
22+
CARGO_TERM_COLOR: always
23+
APP_PATH: ${{ github.event.inputs.app_path }}
24+
25+
jobs:
26+
bundle-windows:
27+
name: Bundle Windows MSIX
28+
runs-on: windows-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Install Rust toolchain
33+
uses: dtolnay/rust-action@stable
34+
35+
- name: Install Deno
36+
uses: denoland/setup-deno@v1
37+
with:
38+
deno-version: v1.x
39+
40+
- name: Cache cargo
41+
uses: actions/cache@v4
42+
with:
43+
path: |
44+
~/.cargo/bin/
45+
~/.cargo/registry/index/
46+
~/.cargo/registry/cache/
47+
~/.cargo/git/db/
48+
target/
49+
key: ${{ runner.os }}-cargo-bundle-${{ hashFiles('**/Cargo.lock') }}
50+
51+
- name: Build app
52+
run: cargo run -p forge -- build ${{ env.APP_PATH }}
53+
54+
- name: Bundle app
55+
run: cargo run -p forge -- bundle ${{ env.APP_PATH }}
56+
57+
- name: Sign MSIX (if requested)
58+
if: github.event.inputs.sign_windows == 'true'
59+
run: |
60+
# Import certificate from secrets
61+
echo "${{ secrets.WINDOWS_CERTIFICATE }}" | base64 -d > cert.pfx
62+
cargo run -p forge -- sign --identity cert.pfx ${{ env.APP_PATH }}/bundle/*.msix
63+
rm cert.pfx
64+
env:
65+
FORGE_SIGNING_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
66+
67+
- name: Upload MSIX
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: windows-msix
71+
path: ${{ env.APP_PATH }}/bundle/*.msix
72+
73+
bundle-macos:
74+
name: Bundle macOS DMG
75+
runs-on: macos-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
79+
- name: Install Rust toolchain
80+
uses: dtolnay/rust-action@stable
81+
82+
- name: Install Deno
83+
uses: denoland/setup-deno@v1
84+
with:
85+
deno-version: v1.x
86+
87+
- name: Cache cargo
88+
uses: actions/cache@v4
89+
with:
90+
path: |
91+
~/.cargo/bin/
92+
~/.cargo/registry/index/
93+
~/.cargo/registry/cache/
94+
~/.cargo/git/db/
95+
target/
96+
key: ${{ runner.os }}-cargo-bundle-${{ hashFiles('**/Cargo.lock') }}
97+
98+
- name: Build app
99+
run: cargo run -p forge -- build ${{ env.APP_PATH }}
100+
101+
- name: Import signing certificate (if requested)
102+
if: github.event.inputs.sign_macos == 'true'
103+
run: |
104+
# Create keychain
105+
security create-keychain -p "" build.keychain
106+
security set-keychain-settings build.keychain
107+
security unlock-keychain -p "" build.keychain
108+
109+
# Import certificate
110+
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 -d > cert.p12
111+
security import cert.p12 -k build.keychain -P "${{ secrets.MACOS_CERTIFICATE_PASSWORD }}" -T /usr/bin/codesign
112+
rm cert.p12
113+
114+
# Set keychain to be used
115+
security list-keychains -s build.keychain
116+
security default-keychain -s build.keychain
117+
118+
# Allow codesign to access keychain
119+
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
120+
env:
121+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
122+
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
123+
124+
- name: Setup notarization credentials (if requested)
125+
if: github.event.inputs.sign_macos == 'true'
126+
run: |
127+
xcrun notarytool store-credentials "forge-notarize" \
128+
--apple-id "${{ secrets.APPLE_ID }}" \
129+
--team-id "${{ secrets.APPLE_TEAM_ID }}" \
130+
--password "${{ secrets.APPLE_APP_PASSWORD }}"
131+
env:
132+
APPLE_ID: ${{ secrets.APPLE_ID }}
133+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
134+
APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
135+
136+
- name: Bundle app
137+
run: cargo run -p forge -- bundle ${{ env.APP_PATH }}
138+
env:
139+
FORGE_SIGNING_IDENTITY: ${{ github.event.inputs.sign_macos == 'true' && secrets.MACOS_SIGNING_IDENTITY || '' }}
140+
FORGE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
141+
FORGE_NOTARIZE: ${{ github.event.inputs.sign_macos }}
142+
143+
- name: Cleanup keychain
144+
if: always() && github.event.inputs.sign_macos == 'true'
145+
run: security delete-keychain build.keychain
146+
147+
- name: Upload DMG
148+
uses: actions/upload-artifact@v4
149+
with:
150+
name: macos-dmg
151+
path: |
152+
${{ env.APP_PATH }}/bundle/*.dmg
153+
${{ env.APP_PATH }}/bundle/*.app
154+
155+
bundle-linux:
156+
name: Bundle Linux AppImage
157+
runs-on: ubuntu-latest
158+
steps:
159+
- uses: actions/checkout@v4
160+
161+
- name: Install Rust toolchain
162+
uses: dtolnay/rust-action@stable
163+
164+
- name: Install Deno
165+
uses: denoland/setup-deno@v1
166+
with:
167+
deno-version: v1.x
168+
169+
- name: Install system dependencies
170+
run: |
171+
sudo apt-get update
172+
sudo apt-get install -y \
173+
libwebkit2gtk-4.1-dev \
174+
libgtk-3-dev \
175+
libayatana-appindicator3-dev \
176+
squashfs-tools \
177+
fuse
178+
179+
- name: Install appimagetool
180+
run: |
181+
wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
182+
chmod +x appimagetool-x86_64.AppImage
183+
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
184+
185+
- name: Cache cargo
186+
uses: actions/cache@v4
187+
with:
188+
path: |
189+
~/.cargo/bin/
190+
~/.cargo/registry/index/
191+
~/.cargo/registry/cache/
192+
~/.cargo/git/db/
193+
target/
194+
key: ${{ runner.os }}-cargo-bundle-${{ hashFiles('**/Cargo.lock') }}
195+
196+
- name: Build app
197+
run: cargo run -p forge -- build ${{ env.APP_PATH }}
198+
199+
- name: Bundle app
200+
run: cargo run -p forge -- bundle ${{ env.APP_PATH }}
201+
202+
- name: Upload AppImage
203+
uses: actions/upload-artifact@v4
204+
with:
205+
name: linux-appimage
206+
path: |
207+
${{ env.APP_PATH }}/bundle/*.AppImage
208+
${{ env.APP_PATH }}/bundle/*.tar.gz

‎.github/workflows/ci.yml‎

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
jobs:
14+
check:
15+
name: Check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install Rust toolchain
21+
uses: dtolnay/rust-action@stable
22+
23+
- name: Cache cargo
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/.cargo/bin/
28+
~/.cargo/registry/index/
29+
~/.cargo/registry/cache/
30+
~/.cargo/git/db/
31+
target/
32+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
33+
34+
- name: Run cargo check
35+
run: cargo check --workspace
36+
37+
test:
38+
name: Test
39+
runs-on: ${{ matrix.os }}
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
os: [ubuntu-latest, macos-latest, windows-latest]
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Install Rust toolchain
48+
uses: dtolnay/rust-action@stable
49+
50+
- name: Cache cargo
51+
uses: actions/cache@v4
52+
with:
53+
path: |
54+
~/.cargo/bin/
55+
~/.cargo/registry/index/
56+
~/.cargo/registry/cache/
57+
~/.cargo/git/db/
58+
target/
59+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
60+
61+
- name: Install system dependencies (Linux)
62+
if: runner.os == 'Linux'
63+
run: |
64+
sudo apt-get update
65+
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev
66+
67+
- name: Run tests
68+
run: cargo test --workspace
69+
70+
fmt:
71+
name: Format
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- name: Install Rust toolchain
77+
uses: dtolnay/rust-action@stable
78+
with:
79+
components: rustfmt
80+
81+
- name: Check formatting
82+
run: cargo fmt --all -- --check
83+
84+
clippy:
85+
name: Clippy
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v4
89+
90+
- name: Install Rust toolchain
91+
uses: dtolnay/rust-action@stable
92+
with:
93+
components: clippy
94+
95+
- name: Install system dependencies
96+
run: |
97+
sudo apt-get update
98+
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev
99+
100+
- name: Cache cargo
101+
uses: actions/cache@v4
102+
with:
103+
path: |
104+
~/.cargo/bin/
105+
~/.cargo/registry/index/
106+
~/.cargo/registry/cache/
107+
~/.cargo/git/db/
108+
target/
109+
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
110+
111+
- name: Run clippy
112+
run: cargo clippy --workspace -- -D warnings

0 commit comments

Comments
 (0)