Skip to content

Commit

Permalink
ci: create proper DMG through package.json (#113)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
NinjaCheetah authored Mar 18, 2023
1 parent f5d669e commit 7a3bf50
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 108 deletions.
59 changes: 26 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,90 +13,83 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Yarn
run: yarn install
- name: Build For Linux
id: build-linux
run: |
yarn build:bundle
yarn build:linux:tar --publish never
yarn build:linux:appimage --publish never
yarn build:linux --publish never
- name: Pack Build Files
run: |
mkdir ~/Revolt-linux-AppImage
mv dist/*.AppImage ~/Revolt-linux-AppImage
mkdir ~/Revolt-linux
mv dist/*.tar.gz ~/Revolt-linux
- name: Publish AppImage
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: ~/Revolt-linux-AppImage/*.AppImage
path: ~/Revolt-linux-AppImage
name: Revolt-linux-AppImage
- name: Publish Tarfile
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: ~/Revolt-linux/*.tar.gz
path: ~/Revolt-linux/
name: Revolt-linux
build-windows:

runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.10.0
uses: ilammy/msvc-dev-cmd@v1.12.1
- name: Install Yarn
run: yarn install
- name: Build For Windows
id: build-windows
run: |
yarn build:bundle
yarn build:windows:nsis --publish never
yarn build:windows:appx --publish never
yarn build:windows --publish never
- name: Pack Build Files
run: |
mkdir D:\a\desktop\Revolt-windows
mv D:\a\desktop\desktop\dist\win-unpacked\* D:\a\desktop\Revolt-windows
mkdir D:\a\desktop\Revolt-windows-Setup
mv D:\a\desktop\desktop\dist\*.exe D:\a\desktop\Revolt-windows-Setup
cd D:\a\desktop
7z a -tzip Revolt-windows.zip Revolt-windows\
7z a -tzip Revolt-windows-Setup.zip Revolt-windows-Setup\
mv D:\a\desktop\desktop\dist\*.exe D:\a\desktop\Revolt-windows-Setup.exe
mkdir D:\a\desktop\Revolt-windows-appx
mv D:\a\desktop\desktop\dist\*.appx D:\a\desktop\Revolt-windows-appx
- name: Publish Zipfile
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: D:\a\desktop\Revolt-windows.zip
path: D:\a\desktop\Revolt-windows
name: Revolt-windows
- name: Publish Installer
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: D:\a\desktop\Revolt-windows-Setup.zip
path: D:\a\desktop\Revolt-windows-Setup.exe
name: Revolt-windows-Setup
- name: Publish Appx
uses: actions/upload-artifact@v3
with:
path: D:\a\desktop\Revolt-windows-appx
name: Revolt-windows-appx
build-macos:

runs-on: macos-11

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Yarn
run: yarn install
- name: Install Tools
run: brew update && brew install create-dmg
- name: Build For macOS
run: |
yarn build:bundle
yarn build:mac --publish never
- name: Create DMG
run: |
mkdir dmg-files/source_folder
mv dist/mac-universal/* dmg-files/source_folder
cd dmg-files
chmod +x makedmg.sh
./makedmg.sh
mv Revolt-Installer.dmg ~
mv dist/*-universal.dmg ~/Revolt-macOS-universal.dmg
- name: Publish Build Files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: ~/Revolt-Installer.dmg
name: Revolt-macOS
path: ~/Revolt-macOS-universal.dmg
name: Revolt-macOS-universal
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Yarn
run: yarn install
- name: Build For Linux
Expand All @@ -27,9 +27,9 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.10.0
uses: ilammy/msvc-dev-cmd@v1.12.1
- name: Install Yarn
run: yarn install
- name: Build For Windows
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: macos-11

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Yarn
run: yarn install
- name: Build For macOS
Expand Down
Binary file added build/dmg/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/dmg/icon.icns
Binary file not shown.
33 changes: 26 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,25 @@
{
"target": "zip",
"arch": [
"x64",
"arm64"
"universal"
]
},
{
"target": "dmg",
"arch": [
"x64",
"arm64"
"universal"
]
}
],
"category": "public.app-category.social-networking"
"category": "public.app-category.social-networking",
"files": "!node_modules/**/*.{mk,a,o,h}"
},
"linux": {
"target": [
{
"target": "AppImage",
"arch": [
"x64",
"ia32",
"armv7l",
"arm64"
]
Expand All @@ -73,7 +71,6 @@
"target": "tar.gz",
"arch": [
"x64",
"ia32",
"armv7l",
"arm64"
]
Expand Down Expand Up @@ -120,6 +117,28 @@
},
"publish": {
"provider": "github"
},
"dmg": {
"background": "build/dmg/background.png",
"icon": "build/dmg/icon.icns",
"iconSize": 80,
"window": {
"x": 200,
"y": 120
},
"contents": [
{
"x": 125,
"y": 185,
"type": "file"
},
{
"x": 375,
"y": 185,
"type": "link",
"path": "/Applications"
}
]
}
},
"dependencies": {
Expand Down
Loading

0 comments on commit 7a3bf50

Please sign in to comment.