Skip to content

Commit 20d3f27

Browse files
committed
Merge branch 'dev'
2 parents fb0c967 + a1140f3 commit 20d3f27

63 files changed

Lines changed: 25190 additions & 258 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/main.yml

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
name: Build
2+
3+
on:
4+
create:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
setup:
10+
name: Setup
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout project
14+
id: checkout
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Cache src
20+
id: cache-src
21+
uses: actions/upload-artifact@v2
22+
with:
23+
name: repo
24+
path: ./*
25+
26+
build_arm64v8:
27+
needs: setup
28+
name: build for arm64v8
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/download-artifact@v2
32+
with:
33+
name: repo
34+
path: ./
35+
36+
- name: Setup
37+
run: |
38+
chmod +wr . -R
39+
chmod +x ./scripts/*.sh
40+
chmod +x ./scripts/*.pl
41+
42+
- name: Set up QEMU
43+
uses: docker/setup-qemu-action@v1
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v1
47+
48+
- name: Build in Docker
49+
id: build
50+
run: |
51+
docker buildx build --platform linux/arm64 -t 4tqrgqe5yrgfd/figma-linux-artefacts-arm --load -f ./docker/Build_artefacts_arm64v8 .
52+
mkdir -p ./build/installers
53+
docker cp $(docker create 4tqrgqe5yrgfd/figma-linux-artefacts-arm)://usr/src/figma-linux/build/installers/. ./build/installers
54+
perl ./scripts/generate_release_notes.pl
55+
56+
- name: Cache arm64v8 artifacts
57+
id: cache-arm64v8-artifacts
58+
uses: actions/upload-artifact@v2
59+
with:
60+
name: arm64v8
61+
path: build/installers/*
62+
63+
release_arm64v8:
64+
name: Upload assets
65+
runs-on: ubuntu-latest
66+
needs: build_arm64v8
67+
steps:
68+
- name: mkdir installers
69+
run: mkdir -p ./build/installers
70+
71+
- uses: actions/download-artifact@v2
72+
with:
73+
name: arm64v8
74+
path: ./build/installers
75+
76+
- name: Get version
77+
id: version
78+
run: |
79+
echo ::set-output name=release::$(cat build/installers/version)
80+
81+
- name: Upload release assets
82+
id: release
83+
uses: softprops/action-gh-release@v1
84+
if: startsWith(github.ref, 'refs/tags/')
85+
with:
86+
name: Figma Linux ${{ steps.version.outputs.release }}
87+
files: build/installers/figma-linux*
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
91+
build_amd64:
92+
runs-on: ubuntu-latest
93+
name: build for amd64
94+
needs: setup
95+
steps:
96+
- uses: actions/download-artifact@v2
97+
with:
98+
name: repo
99+
path: ./
100+
101+
- name: Setup
102+
run: |
103+
chmod +wr . -R
104+
chmod +x ./scripts/*.sh
105+
chmod +x ./scripts/*.pl
106+
107+
- name: Build in Docker
108+
id: build
109+
run: |
110+
docker build -t figma-linux-artefacts -f "./docker/Build_artefacts_local" .
111+
mkdir -p ./build/installers
112+
docker cp $(docker create figma-linux-artefacts:latest)://usr/src/figma-linux/build/installers/. ./build/installers
113+
perl ./scripts/generate_release_notes.pl
114+
115+
- name: Cache amd64 artifacts
116+
id: cache-amd64-artifacts
117+
uses: actions/upload-artifact@v2
118+
with:
119+
name: amd64
120+
path: |
121+
./release_notes
122+
build/installers/*
123+
124+
release_amd64:
125+
name: Upload assets
126+
runs-on: ubuntu-latest
127+
needs: build_amd64
128+
steps:
129+
- name: mkdir installers
130+
run: mkdir -p ./build/installers
131+
132+
- uses: actions/download-artifact@v2
133+
with:
134+
name: amd64
135+
path: ./
136+
137+
- name: Get version
138+
id: version
139+
run: |
140+
echo ::set-output name=release::$(cat build/installers/version)
141+
142+
- name: Upload release assets
143+
id: release
144+
uses: softprops/action-gh-release@v1
145+
if: startsWith(github.ref, 'refs/tags/')
146+
with:
147+
body_path: ./release_notes
148+
name: Figma Linux ${{ steps.version.outputs.release }}
149+
files: build/installers/figma-linux*
150+
env:
151+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152+
153+
upload_ppa_amd64:
154+
name: Upload to Launchpad PPA
155+
runs-on: ubuntu-latest
156+
needs: build_amd64
157+
steps:
158+
- uses: actions/download-artifact@v2
159+
with:
160+
path: ./
161+
162+
- name: Import keys
163+
run: |
164+
ls -la .
165+
mv ./repo/* ./
166+
mv ./amd64/* ./
167+
rm -rf ./repo
168+
rm -rf ./amd64
169+
ls -la .
170+
chmod +x ./scripts/*
171+
ls -la ./scripts
172+
ls -la ./build
173+
ls -la ./build/installers
174+
mkdir ./gpg
175+
echo "${{ secrets.GPG_PUB_KEY }}" | base64 -d > ./gpg/pub.key
176+
echo "${{ secrets.GPG_SECRET_KEY }}" | base64 -d > ./gpg/secret.key
177+
echo "${{ secrets.GPG_PASSPHRASE_KEY }}" | base64 -d > ./gpg/passphrase
178+
echo "${{ secrets.ID_RSA }}" | base64 -d > ./gpg/id_rsa
179+
180+
- name: Login to DockerHub
181+
uses: docker/login-action@v1
182+
with:
183+
username: ${{ secrets.DOCKER_USERNAME }}
184+
password: ${{ secrets.DOCKER_PASSWORD }}
185+
186+
- name: Build and Upload PPA
187+
run: |
188+
./scripts/build_ppa.sh
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Artifacts
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
age:
7+
description: 'Age'
8+
required: true
9+
default: '1 hour'
10+
11+
jobs:
12+
setup:
13+
name: Remove artifacts
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Remove artifacts
17+
uses: c-hive/gha-remove-artifacts@v1
18+
with:
19+
age: ${{ github.event.inputs.age }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules
22
*.log
33
dist
4+
gpg
45
gui
56
build
67
*.deb

@types/Common/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,13 @@ interface FeatureFlags {
144144

145145
interface SettingsInterface {
146146
clientId: string;
147+
userId: string;
148+
authedUserIDs: string[];
147149
app: {
148150
logLevel: number;
149151
enableColorSpaceSrgb: boolean;
150152
visibleNewProjectBtn: boolean;
153+
useZenity: boolean;
151154
panelHeight: number;
152155
saveLastOpenedTabs: boolean;
153156
exportDir: string;

@types/Main/dialogs.d.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
declare namespace Dialogs {
2+
type Providers = "Native" | "Zenity";
3+
type Type = "error" | "warning" | "info" | "question";
4+
5+
interface SaveOptions {
6+
title?: string;
7+
defaultPath?: string;
8+
showsTagField?: boolean;
9+
}
10+
interface OpenOptions {
11+
buttonLabel?: string;
12+
defaultPath?: string;
13+
properties?: string[];
14+
}
15+
16+
type MessageBoxOptions = ErrorBoxOptions | QuestionBoxOptions | WarningBoxOptions;
17+
interface BaseBoxOptions {
18+
textOkButton?: string;
19+
title?: string;
20+
message: string;
21+
detail?: string;
22+
}
23+
interface ErrorBoxOptions extends BaseBoxOptions {
24+
type: "error";
25+
}
26+
interface WarningBoxOptions extends BaseBoxOptions {
27+
type: "warning";
28+
}
29+
interface QuestionBoxOptions extends BaseBoxOptions {
30+
type: "question";
31+
textCancelButton?: string;
32+
defaultFocusedButton: "Ok" | "Cancel";
33+
}
34+
}
35+
36+
declare interface ProviderDialog {
37+
showMessageBox(params: Dialogs.MessageBoxOptions): Promise<number>;
38+
showMessageBoxSync(params: Dialogs.MessageBoxOptions): number;
39+
40+
showOpenDialog(params: Dialogs.OpenOptions): Promise<string[] | null>;
41+
showOpenDialogSync(params: Dialogs.OpenOptions): string[] | null;
42+
43+
showSaveDialog(params: Dialogs.SaveOptions): Promise<string | null>;
44+
showSaveDialogSync(params: Dialogs.SaveOptions): string | null;
45+
}

@types/Renderer/webApi.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,17 @@ declare namespace WebApi {
4848
path: string;
4949
postscript: string;
5050
}
51+
52+
interface SetUser {
53+
id: string;
54+
}
55+
interface SetAuthedUsers {
56+
userIDs: string[];
57+
}
58+
interface SetWorkspaceName {
59+
name: string;
60+
}
61+
interface SetFigjamEnabled {
62+
figjamEnabled: boolean;
63+
}
5164
}

@types/index.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ declare namespace Electron {
6767
on(channel: "updatePanelScale", listener: (event: IpcMainInvokeEvent, scale: number) => void): this;
6868
on(channel: "startAppAuth", listener: (event: IpcMainInvokeEvent, auth: { grantPath: string }) => void): this;
6969
on(channel: "finishAppAuth", listener: (event: IpcMainInvokeEvent, auth: { redirectURL: string }) => void): this;
70+
on(channel: "setAuthedUsers", listener: (event: IpcMainInvokeEvent, userIds: string[]) => void): this;
71+
on(channel: "setWorkspaceName", listener: (event: IpcMainInvokeEvent, name: string) => void): this;
72+
on(channel: "setFigjamEnabled", listener: (event: IpcMainInvokeEvent, enabled: boolean) => void): this;
7073
on(
7174
channel: "setFeatureFlags",
7275
listener: (event: IpcMainInvokeEvent, auth: { featureFlags: FeatureFlags }) => void,
@@ -92,6 +95,8 @@ declare namespace Electron {
9295
channel: "set-clipboard-data",
9396
listener: (event: IpcMainInvokeEvent, data: WebApi.SetClipboardData) => void,
9497
): this;
98+
on(channel: "set-use-zenity", listener: (event: IpcMainInvokeEvent, value: boolean) => void): this;
99+
on(channel: "set-settings", listener: (event: IpcMainInvokeEvent, settings: SettingsInterface) => void): this;
95100

96101
handle(
97102
channel: "writeNewExtensionToDisk",
@@ -126,6 +131,8 @@ declare namespace Electron {
126131
channel: "get-font-file",
127132
listener: (event: IpcMainInvokeEvent, data: WebApi.GetFontFile) => Promise<void> | Buffer,
128133
): void;
134+
handle(channel: "add-font-directories", listener: (event: IpcMainInvokeEvent) => Promise<string[] | null>): void;
135+
handle(channel: "select-export-directory", listener: (event: IpcMainInvokeEvent) => Promise<string | null>): void;
129136
}
130137

131138
interface IpcRenderer extends NodeJS.EventEmitter {
@@ -183,6 +190,8 @@ declare namespace Electron {
183190
send(channel: "saveCreatorTheme", theme: Themes.Theme): this;
184191
send(channel: "sync-themes"): this;
185192
send(channel: "set-clipboard-data", data: WebApi.SetClipboardData): this;
193+
send(channel: "set-use-zenity", value: boolean): this;
194+
send(channel: "set-settings", settings: SettingsInterface): this;
186195

187196
invoke(channel: "writeNewExtensionToDisk", data: WebApi.WriteNewExtensionToDiskArgs): Promise<number>;
188197
invoke(channel: "getAllLocalFileExtensionIds"): Promise<number[]>;
@@ -196,6 +205,8 @@ declare namespace Electron {
196205
invoke(channel: "writeFiles", data: WebApi.WriteFiles): Promise<void>;
197206
invoke(channel: "get-fonts"): Promise<FontsMap>;
198207
invoke(channel: "get-font-file", data: WebApi.GetFontFile): Promise<Buffer>;
208+
invoke(channel: "add-font-directories"): Promise<string[] | null>;
209+
invoke(channel: "select-export-directory"): Promise<string | null>;
199210
}
200211

201212
interface WebContents extends NodeJS.EventEmitter {

config/builder.json

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
},
3737

3838
"appImage": {
39-
"category": "Graphics"
39+
"category": "Graphics",
40+
"desktop": "resources/figma-linux-appimage.desktop"
4041
},
4142

4243
"linux": {
@@ -55,28 +56,19 @@
5556
],
5657
"target": [
5758
{
58-
"target": "deb",
59-
"arch": [
60-
"x64"
61-
]
59+
"target": "deb"
6260
},
6361
{
64-
"target": "zip",
65-
"arch": [
66-
"x64"
67-
]
62+
"target": "zip"
6863
},
6964
{
70-
"target": "rpm",
71-
"arch": [
72-
"x64"
73-
]
65+
"target": "rpm"
7466
},
7567
{
76-
"target": "pacman",
77-
"arch": [
78-
"x64"
79-
]
68+
"target": "pacman"
69+
},
70+
{
71+
"target": "appimage"
8072
}
8173
]
8274
}

0 commit comments

Comments
 (0)