-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (94 loc) · 3.92 KB
/
Copy pathrelease.yml
File metadata and controls
103 lines (94 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Release Desktop
# Builds the desktop app for macOS (universal), Linux, and Windows and attaches
# the installers to a GitHub Release. Triggered by pushing a v* tag, or manually.
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g. v0.1.1)"
required: true
jobs:
build:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest # Intel + Apple Silicon (universal)
args: "--target universal-apple-darwin"
- platform: ubuntu-22.04 # .deb + .AppImage
args: ""
- platform: windows-latest # .msi + .exe
args: ""
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 20
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./desktop/src-tauri -> target"
- name: Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Install desktop deps
working-directory: desktop
run: npm install
# Enable macOS Developer ID signing + notarization ONLY when the secrets
# are present. Tauri treats a defined-but-empty APPLE_CERTIFICATE as
# "sign me" and then fails, so we write the vars into $GITHUB_ENV only if a
# cert was actually provided. With no secrets, the build stays unsigned.
- name: Configure macOS signing (gated on secrets)
if: matrix.platform == 'macos-latest'
shell: bash
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
if [ -z "$APPLE_CERTIFICATE" ]; then
echo "No APPLE_CERTIFICATE secret - building UNSIGNED (no signing/notarization)."
exit 0
fi
echo "Developer ID signing + notarization enabled."
{
echo "APPLE_CERTIFICATE<<__LC_EOF__"
echo "$APPLE_CERTIFICATE"
echo "__LC_EOF__"
echo "APPLE_CERTIFICATE_PASSWORD=$APPLE_CERTIFICATE_PASSWORD"
echo "APPLE_SIGNING_IDENTITY=$APPLE_SIGNING_IDENTITY"
echo "APPLE_ID=$APPLE_ID"
echo "APPLE_PASSWORD=$APPLE_PASSWORD"
echo "APPLE_TEAM_ID=$APPLE_TEAM_ID"
} >> "$GITHUB_ENV"
- name: Build + release
uses: tauri-apps/tauri-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# macOS signing/notarization vars are injected by the gated step above
# (only present when the secrets are set). See docs/RELEASING.md.
with:
projectPath: desktop
tagName: ${{ github.ref_type == 'tag' && github.ref_name || inputs.tag }}
# Title from the TAG, not tauri.conf.json's app version: the conf
# version lags behind tags, which once left 13 releases all titled
# with the same stale number.
releaseName: "LightNode ${{ github.ref_type == 'tag' && github.ref_name || inputs.tag }}"
releaseBody: "LightNode desktop: one-click LightChain AI worker onboarding and operations. Download the installer for your OS below."
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}