|
1 | | -name: Release |
| 1 | +name: Release Build |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | tags: |
6 | 6 | - 'v*' |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + version: |
| 10 | + description: 'Version tag (e.g. v1.1.0)' |
| 11 | + required: true |
7 | 12 |
|
8 | | -jobs: |
9 | | - release-macos: |
10 | | - name: Build macOS DMG |
11 | | - runs-on: macos-latest |
12 | | - permissions: |
13 | | - contents: write |
| 13 | +permissions: |
| 14 | + contents: write |
14 | 15 |
|
| 16 | +jobs: |
| 17 | + build-linux: |
| 18 | + runs-on: ubuntu-latest |
15 | 19 | steps: |
16 | 20 | - uses: actions/checkout@v4 |
17 | 21 |
|
18 | | - - name: Install pnpm |
19 | | - uses: pnpm/action-setup@v4 |
| 22 | + - name: Install system dependencies |
| 23 | + run: | |
| 24 | + sudo apt-get update |
| 25 | + sudo apt-get install -y \ |
| 26 | + libwebkit2gtk-4.1-dev \ |
| 27 | + libgtk-3-dev \ |
| 28 | + libayatana-appindicator3-dev \ |
| 29 | + librsvg2-dev \ |
| 30 | + patchelf |
| 31 | +
|
| 32 | + - uses: pnpm/action-setup@v4 |
20 | 33 | with: |
21 | | - version: latest |
| 34 | + version: 9 |
22 | 35 |
|
23 | | - - name: Setup Node.js |
24 | | - uses: actions/setup-node@v4 |
| 36 | + - uses: actions/setup-node@v4 |
25 | 37 | with: |
26 | 38 | node-version: 20 |
27 | | - cache: pnpm |
| 39 | + cache: 'pnpm' |
28 | 40 |
|
29 | | - - name: Install Rust (stable + universal Apple targets) |
30 | | - uses: dtolnay/rust-toolchain@stable |
31 | | - with: |
32 | | - targets: aarch64-apple-darwin,x86_64-apple-darwin |
| 41 | + - uses: dtolnay/rust-toolchain@stable |
33 | 42 |
|
34 | | - - name: Rust build cache |
35 | | - uses: swatinem/rust-cache@v2 |
| 43 | + - uses: Swatinem/rust-cache@v2 |
36 | 44 | with: |
37 | 45 | workspaces: src-tauri |
38 | 46 |
|
39 | | - - name: Install JS dependencies |
| 47 | + - name: Install dependencies |
40 | 48 | run: pnpm install --frozen-lockfile |
41 | 49 |
|
42 | | - # ── Code signing (skip gracefully when secrets are absent) ──────────── |
43 | | - - name: Import Apple Developer certificate |
44 | | - if: env.APPLE_CERTIFICATE != '' |
| 50 | + - name: Build frontend |
| 51 | + run: pnpm frontend:build |
45 | 52 | env: |
46 | | - APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} |
47 | | - APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} |
48 | | - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} |
| 53 | + CI: true |
| 54 | + |
| 55 | + - name: Build Tauri (Linux) |
49 | 56 | run: | |
50 | | - KEYCHAIN_PATH=$RUNNER_TEMP/build.keychain |
51 | | - CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12 |
52 | | - echo -n "$APPLE_CERTIFICATE" | base64 --decode -o "$CERTIFICATE_PATH" |
53 | | - security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" |
54 | | - security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" |
55 | | - security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" |
56 | | - security import "$CERTIFICATE_PATH" \ |
57 | | - -P "$APPLE_CERTIFICATE_PASSWORD" \ |
58 | | - -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" |
59 | | - security list-keychain -d user -s "$KEYCHAIN_PATH" |
60 | | -
|
61 | | - # ── Build ───────────────────────────────────────────────────────────── |
62 | | - - name: Build universal DMG (arm64 + x86_64) |
| 57 | + cd src-tauri |
| 58 | + cargo build --release |
| 59 | + cargo tauri build --bundles appimage,deb |
63 | 60 | env: |
64 | | - # Tauri updater key (optional — set to skip updater signing) |
65 | | - TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} |
66 | | - TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} |
67 | | - # Apple code signing (optional — leave unset to build unsigned) |
68 | | - APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} |
69 | | - # Apple notarization (optional — requires signing identity) |
70 | | - APPLE_ID: ${{ secrets.APPLE_ID }} |
71 | | - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} |
72 | | - APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} |
73 | | - run: pnpm tauri build --target universal-apple-darwin |
74 | | - |
75 | | - # ── Locate artefact ─────────────────────────────────────────────────── |
76 | | - - name: Locate DMG |
77 | | - id: dmg |
78 | | - run: | |
79 | | - DMG=$(find src-tauri/target/universal-apple-darwin/release/bundle/dmg -name '*.dmg' | head -n 1) |
80 | | - echo "path=$DMG" >> "$GITHUB_OUTPUT" |
81 | | - echo "name=$(basename "$DMG")" >> "$GITHUB_OUTPUT" |
| 61 | + CI: true |
| 62 | + |
| 63 | + - name: Upload Linux artifacts |
| 64 | + uses: actions/upload-artifact@v4 |
| 65 | + with: |
| 66 | + name: linux-builds |
| 67 | + path: | |
| 68 | + src-tauri/target/release/bundle/appimage/*.AppImage |
| 69 | + src-tauri/target/release/bundle/deb/*.deb |
| 70 | +
|
| 71 | + - name: Upload to release |
| 72 | + if: startsWith(github.ref, 'refs/tags/') |
| 73 | + uses: softprops/action-gh-release@v2 |
| 74 | + with: |
| 75 | + files: | |
| 76 | + src-tauri/target/release/bundle/appimage/*.AppImage |
| 77 | + src-tauri/target/release/bundle/deb/*.deb |
| 78 | +
|
| 79 | + build-macos: |
| 80 | + runs-on: macos-latest |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v4 |
| 83 | + |
| 84 | + - uses: pnpm/action-setup@v4 |
| 85 | + with: |
| 86 | + version: 9 |
| 87 | + |
| 88 | + - uses: actions/setup-node@v4 |
| 89 | + with: |
| 90 | + node-version: 20 |
| 91 | + cache: 'pnpm' |
| 92 | + |
| 93 | + - uses: dtolnay/rust-toolchain@stable |
| 94 | + |
| 95 | + - uses: Swatinem/rust-cache@v2 |
| 96 | + with: |
| 97 | + workspaces: src-tauri |
| 98 | + |
| 99 | + - name: Install dependencies |
| 100 | + run: pnpm install --frozen-lockfile |
| 101 | + |
| 102 | + - name: Build Tauri (macOS) |
| 103 | + run: pnpm desktop:build |
| 104 | + env: |
| 105 | + CI: true |
82 | 106 |
|
83 | | - # ── Upload artefact (always — useful for inspection) ────────────────── |
84 | | - - name: Upload DMG artefact |
| 107 | + - name: Upload macOS artifacts |
85 | 108 | uses: actions/upload-artifact@v4 |
86 | 109 | with: |
87 | | - name: ${{ steps.dmg.outputs.name }} |
88 | | - path: ${{ steps.dmg.outputs.path }} |
89 | | - if-no-files-found: error |
| 110 | + name: macos-builds |
| 111 | + path: src-tauri/target/release/bundle/dmg/*.dmg |
90 | 112 |
|
91 | | - # ── Create a DRAFT release (assets are private until published) ─────── |
92 | | - - name: Create draft GitHub release |
| 113 | + - name: Upload to release |
| 114 | + if: startsWith(github.ref, 'refs/tags/') |
93 | 115 | uses: softprops/action-gh-release@v2 |
94 | 116 | with: |
95 | | - draft: true |
96 | | - name: Knot Code ${{ github.ref_name }} |
97 | | - files: ${{ steps.dmg.outputs.path }} |
98 | | - generate_release_notes: true |
99 | | - body: | |
100 | | - ## Knot Code ${{ github.ref_name }} |
101 | | -
|
102 | | - > **Sponsor-only download.** |
103 | | - > Verify your [GitHub Sponsorship](https://github.com/sponsors/bunsdev) at |
104 | | - > https://openknot.ai/download to receive the download link. |
105 | | -
|
106 | | - See the auto-generated changelog below for what's new. |
| 117 | + files: src-tauri/target/release/bundle/dmg/*.dmg |
0 commit comments