Skip to content

Commit 7a3bf50

Browse files
authored
ci: create proper DMG through package.json (#113)
* Updated package.json to build proper DMG electron-builder v22 -> v23 to fix builds on macOS 12.3+ * Made sure to use Python3 when building for future-proofing * (Re-)Update dependencies accidentally downgraded * Fix universal macOS builds, testing fixed workflow * Remove extra x86/ARM-only builds for macOS * Update checkout@v2 -> checkout@v3 * Remove Linux ia32 build because Electron isn't available for ia32 (This would prevent you from building the Linux version at all) * Clean up Linux workflow (uses new upload-artifact@v3 featuers) * Polish Linux/Windows workflows * Fix Windows workflow not publishing instaler * Update actions to Node.js 16 in publism.yml * Quick change, publish the Windows Appx builds * I seem to have forgotten a single backslash
1 parent f5d669e commit 7a3bf50

File tree

6 files changed

+127
-108
lines changed

6 files changed

+127
-108
lines changed

Diff for: .github/workflows/main.yml

+26-33
Original file line numberDiff line numberDiff line change
@@ -13,90 +13,83 @@ jobs:
1313

1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
- name: Install Yarn
1818
run: yarn install
1919
- name: Build For Linux
2020
id: build-linux
2121
run: |
2222
yarn build:bundle
23-
yarn build:linux:tar --publish never
24-
yarn build:linux:appimage --publish never
23+
yarn build:linux --publish never
2524
- name: Pack Build Files
2625
run: |
2726
mkdir ~/Revolt-linux-AppImage
2827
mv dist/*.AppImage ~/Revolt-linux-AppImage
2928
mkdir ~/Revolt-linux
3029
mv dist/*.tar.gz ~/Revolt-linux
3130
- name: Publish AppImage
32-
uses: actions/upload-artifact@v2
31+
uses: actions/upload-artifact@v3
3332
with:
34-
path: ~/Revolt-linux-AppImage/*.AppImage
33+
path: ~/Revolt-linux-AppImage
3534
name: Revolt-linux-AppImage
3635
- name: Publish Tarfile
37-
uses: actions/upload-artifact@v2
36+
uses: actions/upload-artifact@v3
3837
with:
39-
path: ~/Revolt-linux/*.tar.gz
38+
path: ~/Revolt-linux/
4039
name: Revolt-linux
4140
build-windows:
4241

4342
runs-on: windows-latest
4443

4544
steps:
46-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v3
4746
- name: Enable Developer Command Prompt
48-
uses: ilammy/msvc-dev-cmd@v1.10.0
47+
uses: ilammy/msvc-dev-cmd@v1.12.1
4948
- name: Install Yarn
5049
run: yarn install
5150
- name: Build For Windows
5251
id: build-windows
5352
run: |
5453
yarn build:bundle
55-
yarn build:windows:nsis --publish never
56-
yarn build:windows:appx --publish never
54+
yarn build:windows --publish never
5755
- name: Pack Build Files
5856
run: |
5957
mkdir D:\a\desktop\Revolt-windows
6058
mv D:\a\desktop\desktop\dist\win-unpacked\* D:\a\desktop\Revolt-windows
6159
mkdir D:\a\desktop\Revolt-windows-Setup
62-
mv D:\a\desktop\desktop\dist\*.exe D:\a\desktop\Revolt-windows-Setup
63-
cd D:\a\desktop
64-
7z a -tzip Revolt-windows.zip Revolt-windows\
65-
7z a -tzip Revolt-windows-Setup.zip Revolt-windows-Setup\
60+
mv D:\a\desktop\desktop\dist\*.exe D:\a\desktop\Revolt-windows-Setup.exe
61+
mkdir D:\a\desktop\Revolt-windows-appx
62+
mv D:\a\desktop\desktop\dist\*.appx D:\a\desktop\Revolt-windows-appx
6663
- name: Publish Zipfile
67-
uses: actions/upload-artifact@v2
64+
uses: actions/upload-artifact@v3
6865
with:
69-
path: D:\a\desktop\Revolt-windows.zip
66+
path: D:\a\desktop\Revolt-windows
7067
name: Revolt-windows
7168
- name: Publish Installer
72-
uses: actions/upload-artifact@v2
69+
uses: actions/upload-artifact@v3
7370
with:
74-
path: D:\a\desktop\Revolt-windows-Setup.zip
71+
path: D:\a\desktop\Revolt-windows-Setup.exe
7572
name: Revolt-windows-Setup
73+
- name: Publish Appx
74+
uses: actions/upload-artifact@v3
75+
with:
76+
path: D:\a\desktop\Revolt-windows-appx
77+
name: Revolt-windows-appx
7678
build-macos:
7779

7880
runs-on: macos-11
7981

8082
steps:
81-
- uses: actions/checkout@v2
83+
- uses: actions/checkout@v3
8284
- name: Install Yarn
8385
run: yarn install
84-
- name: Install Tools
85-
run: brew update && brew install create-dmg
8686
- name: Build For macOS
8787
run: |
8888
yarn build:bundle
8989
yarn build:mac --publish never
90-
- name: Create DMG
91-
run: |
92-
mkdir dmg-files/source_folder
93-
mv dist/mac-universal/* dmg-files/source_folder
94-
cd dmg-files
95-
chmod +x makedmg.sh
96-
./makedmg.sh
97-
mv Revolt-Installer.dmg ~
90+
mv dist/*-universal.dmg ~/Revolt-macOS-universal.dmg
9891
- name: Publish Build Files
99-
uses: actions/upload-artifact@v2
92+
uses: actions/upload-artifact@v3
10093
with:
101-
path: ~/Revolt-Installer.dmg
102-
name: Revolt-macOS
94+
path: ~/Revolt-macOS-universal.dmg
95+
name: Revolt-macOS-universal

Diff for: .github/workflows/publish.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Install Yarn
1717
run: yarn install
1818
- name: Build For Linux
@@ -27,9 +27,9 @@ jobs:
2727
runs-on: windows-latest
2828

2929
steps:
30-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
3131
- name: Enable Developer Command Prompt
32-
uses: ilammy/msvc-dev-cmd@v1.10.0
32+
uses: ilammy/msvc-dev-cmd@v1.12.1
3333
- name: Install Yarn
3434
run: yarn install
3535
- name: Build For Windows
@@ -44,7 +44,7 @@ jobs:
4444
runs-on: macos-11
4545

4646
steps:
47-
- uses: actions/checkout@v2
47+
- uses: actions/checkout@v3
4848
- name: Install Yarn
4949
run: yarn install
5050
- name: Build For macOS

Diff for: build/dmg/background.png

8.86 KB
Loading

Diff for: build/dmg/icon.icns

24.3 KB
Binary file not shown.

Diff for: package.json

+26-7
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,25 @@
4444
{
4545
"target": "zip",
4646
"arch": [
47-
"x64",
48-
"arm64"
47+
"universal"
4948
]
5049
},
5150
{
5251
"target": "dmg",
5352
"arch": [
54-
"x64",
55-
"arm64"
53+
"universal"
5654
]
5755
}
5856
],
59-
"category": "public.app-category.social-networking"
57+
"category": "public.app-category.social-networking",
58+
"files": "!node_modules/**/*.{mk,a,o,h}"
6059
},
6160
"linux": {
6261
"target": [
6362
{
6463
"target": "AppImage",
6564
"arch": [
6665
"x64",
67-
"ia32",
6866
"armv7l",
6967
"arm64"
7068
]
@@ -73,7 +71,6 @@
7371
"target": "tar.gz",
7472
"arch": [
7573
"x64",
76-
"ia32",
7774
"armv7l",
7875
"arm64"
7976
]
@@ -120,6 +117,28 @@
120117
},
121118
"publish": {
122119
"provider": "github"
120+
},
121+
"dmg": {
122+
"background": "build/dmg/background.png",
123+
"icon": "build/dmg/icon.icns",
124+
"iconSize": 80,
125+
"window": {
126+
"x": 200,
127+
"y": 120
128+
},
129+
"contents": [
130+
{
131+
"x": 125,
132+
"y": 185,
133+
"type": "file"
134+
},
135+
{
136+
"x": 375,
137+
"y": 185,
138+
"type": "link",
139+
"path": "/Applications"
140+
}
141+
]
123142
}
124143
},
125144
"dependencies": {

0 commit comments

Comments
 (0)