Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
JustYuuto committed Nov 23, 2024
1 parent 88f749d commit 583a751
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,39 @@ jobs:
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build
run: yarn build linux

- name: Upload .snap file
uses: actions/upload-artifact@v4
with:
path: dist/*.snap
name: ${{ runner.os }}-snap

- name: Upload .deb file
uses: actions/upload-artifact@v4
with:
path: dist/*.deb
name: ${{ runner.os }}-deb

- name: Upload .AppImage file
uses: actions/upload-artifact@v4
with:
path: dist/*.AppImage
name: ${{ runner.os }}-AppImage

- name: Upload .rpm file
uses: actions/upload-artifact@v4
with:
path: dist/*.rpm
name: ${{ runner.os }}-rpm

build-windows:
runs-on: windows-latest
Expand All @@ -51,20 +55,21 @@ jobs:
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build
run: yarn build windows

- name: Upload .exe file
uses: actions/upload-artifact@v4
with:
path: dist/*.exe
name: ${{ runner.os }}-exe

build-macos:
runs-on: macos-latest
Expand All @@ -73,17 +78,18 @@ jobs:
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build
run: yarn build macos

- name: Upload .dmg file
uses: actions/upload-artifact@v4
with:
path: dist/*.dmg
name: ${{ runner.os }}-dmg
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 22

Expand Down
23 changes: 20 additions & 3 deletions bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,26 @@ const options = {
x64: true,
publish: 'never',
};
if (process.platform === 'darwin') options.mac = config.mac.target;
// Linux programs like chmod are not supported on Windows
if (process.platform !== 'win32') options.linux = config.linux.target;
const specifiedOS = process.argv[2];
if (specifiedOS) {
if (specifiedOS === 'windows') {
config.mac = undefined;
config.linux = undefined;
config.win = config.win.target;
} else if (specifiedOS === 'macos') {
config.linux = undefined;
config.win = undefined;
config.mac = config.mac.target;
} else if (specifiedOS === 'linux') {
config.mac = undefined;
config.win = undefined;
config.linux = config.linux.target;
}
} else {
if (process.platform === 'darwin') options.mac = config.mac.target;
// Linux programs like chmod are not supported on Windows
if (process.platform !== 'win32') options.linux = config.linux.target;
}

builder.build(options).then(() => {
console.log('\nSetup built in the "dist" folder.');
Expand Down

0 comments on commit 583a751

Please sign in to comment.