forked from yorkie-team/codepair
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor build command in windows-build.yml: Update NSIS installation…
… and add x64 architecture support
- Loading branch information
Showing
2 changed files
with
91 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: electron-windows-nsis-build | ||
name: Build and Publish Electron App | ||
|
||
on: | ||
push: | ||
|
@@ -7,59 +7,66 @@ on: | |
|
||
jobs: | ||
build: | ||
runs-on: windows-2019 | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
node-version: "18.x" | ||
|
||
- name: Set up pnpm | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 8 | ||
|
||
- name: Install global electron-builder | ||
run: npm install -g [email protected] | ||
|
||
- name: Check NSIS version | ||
run: | | ||
$nsisPath = "C:\Program Files (x86)\NSIS\makensis.exe" | ||
if (Test-Path $nsisPath) { | ||
Write-Output "NSIS version:" | ||
& $nsisPath /VERSION | ||
} else { | ||
Write-Output "NSIS not found in expected location." | ||
exit 1 | ||
} | ||
shell: pwsh | ||
|
||
- name: Clear npm cache | ||
run: npm cache clean --force | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --prefer-offline --no-frozen-lockfile | ||
working-directory: ./native | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build Electron App | ||
- name: Build TypeScript | ||
run: pnpm run build | ||
working-directory: ./native | ||
|
||
- name: Create NSIS Installer | ||
run: pnpm run electron-builder -- --win --publish always | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Make Electron app | ||
run: pnpm run make | ||
working-directory: ./native | ||
|
||
- name: Upload Release Assets | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
files: ./native/release/**/*.exe | ||
name: ${{ matrix.os }}-build | ||
path: native/out/make/**/* | ||
|
||
publish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18.x" | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 8 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
working-directory: ./native | ||
|
||
- name: Publish Electron app | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: pnpm run publish | ||
working-directory: ./native |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters