Skip to content

Commit

Permalink
Merge branch 'dev' into dependabot/npm_and_yarn/desktop-app/axios-1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjeannesson authored Mar 14, 2024
2 parents 0e4bc2a + 1615af9 commit 9420404
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 62 deletions.
93 changes: 73 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,88 @@ on:
release:
types: [published]



jobs:
release:
runs-on: ${{ matrix.os }}

build:
name: Build
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

include:
- platform: mac
os: "macos-12"
- platform: linux
os: "ubuntu-22.04"
- platform: windows
os: "windows-2022"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ github.event.release.target_commitish }}

- name: Setup Node.js
- name: Settp Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20

- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install --network-timeout 1000000 # will run `yarn install` command
dir: desktop-app
- name: Update package.json
run: |
./set-version.sh
- name: Build production bundle
uses: borales/actions-yarn@v5
with:
cmd: build # will run `yarn build` command (for each os)
dir: desktop-app

- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-distributables
path: desktop-app/dist/Napse-*
if-no-files-found: error
publish:
name: Publish
runs-on: "ubuntu-22.04"
needs: build
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}

- name: Get all distributables
uses: actions/download-artifact@v3

- name: Get distributables
run: |
mkdir distributables
cp -r linux-distributables/* distributables/
cp -r mac-distributables/* distributables/
cp -r windows-distributables/* distributables/
ls distributables
- name: Filter out .blockmap files
run: |
find distributables -name '*.blockmap' -exec rm {} +
- name: Tag Docker image
run: |
TAG_NAME=$(grep -oP '(?<=# \[)[^\]]+' CHANGELOG.md | head -n 1)
VERSION=v$TAG_NAME
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
- name: Publish all artifacts to GitHub Releases
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
files: distributables/*
tag_name: ${{ env.VERSION }}
body: ${{ github.event.release.body }}
draft: false
prerelease: false

# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
8 changes: 1 addition & 7 deletions .github/workflows/nextron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Settp Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20

- name: Run install
uses: borales/actions-yarn@v5
Expand All @@ -44,9 +44,3 @@ jobs:
with:
cmd: build # will run `yarn build` command (for each os)
dir: desktop-app

- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-distributables
path: desktop-app/dist/Napse-*
if-no-files-found: error
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pids
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
Expand Down
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
## [1.7.11](https://github.com/napse-invest/Napse/compare/v1.7.10...v1.7.11) (2024-03-14)


### Bug Fixes

* **ci:** build ([bae11b9](https://github.com/napse-invest/Napse/commit/bae11b9bd4447042e040c90c896811d1371a30c1))

## [1.7.10](https://github.com/napse-invest/Napse/compare/v1.7.9...v1.7.10) (2024-03-14)


### Bug Fixes

* **ci:** build ([ca7dc60](https://github.com/napse-invest/Napse/commit/ca7dc60cba4f950749eee8ffa2fb5291c12182f6))

## [1.7.9](https://github.com/napse-invest/Napse/compare/v1.7.8...v1.7.9) (2024-03-14)


### Bug Fixes

* **ci:** build ([47c7574](https://github.com/napse-invest/Napse/commit/47c75747ed2afcf6121411281a642f113212796d))

## [1.7.8](https://github.com/napse-invest/Napse/compare/v1.7.7...v1.7.8) (2024-03-14)


### Bug Fixes

* **ci:** build ([42668ad](https://github.com/napse-invest/Napse/commit/42668ad114c36160beffcac9031409dc05853f37))

## [1.7.7](https://github.com/napse-invest/Napse/compare/v1.7.6...v1.7.7) (2024-03-14)


### Bug Fixes

* **ci:** build ([eed19f2](https://github.com/napse-invest/Napse/commit/eed19f2c9db6ccd89727afa140c0059a55387939))

## [1.7.6](https://github.com/napse-invest/Napse/compare/v1.7.5...v1.7.6) (2024-03-14)


### Bug Fixes

* **ci:** build ([22a18d2](https://github.com/napse-invest/Napse/commit/22a18d29205f8be5e5ff1c9f1e9d3e20e28aa4cf))

## [1.7.5](https://github.com/napse-invest/Napse/compare/v1.7.4...v1.7.5) (2024-03-14)


### Bug Fixes

* **ci:** build ([24a1acf](https://github.com/napse-invest/Napse/commit/24a1acfafd051a8647ab3f7f3f141189e0a6b294))
* **ci:** build ([3eb13c7](https://github.com/napse-invest/Napse/commit/3eb13c79f94b13d2e4aeacbc3d29db023192a8f5))

## [1.7.4](https://github.com/napse-invest/Napse/compare/v1.7.3...v1.7.4) (2024-03-14)


### Bug Fixes

* **ci:** build ([d55288b](https://github.com/napse-invest/Napse/commit/d55288b6e29cdef178d2f7623cf342bdcfd3e35c))

## [1.7.3](https://github.com/napse-invest/Napse/compare/v1.7.2...v1.7.3) (2024-03-14)


### Bug Fixes

* **ci:** build ([3ef8c0f](https://github.com/napse-invest/Napse/commit/3ef8c0fce370dc436df56b874dac7fa5f06a3497))

## [1.7.2](https://github.com/napse-invest/Napse/compare/v1.7.1...v1.7.2) (2024-03-14)


### Bug Fixes

* **ci:** build ([d394ff6](https://github.com/napse-invest/Napse/commit/d394ff6a0f51659ad966059aa2bcc3d6f130ee48))

## [1.7.1](https://github.com/napse-invest/Napse/compare/v1.7.0...v1.7.1) (2024-03-14)


Expand Down
54 changes: 27 additions & 27 deletions desktop-app/main/background.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EnvironmentStatus } from '@aws-sdk/client-elastic-beanstalk'
import { BrowserWindow, app, autoUpdater, dialog, ipcMain } from 'electron'
import { BrowserWindow, app, ipcMain } from 'electron'
import serve from 'electron-serve'
import {
EB_APP_NAME,
Expand All @@ -25,34 +25,34 @@ if (isProd) {
;(async () => {
await app.whenReady()

if (isProd) {
const server = 'https://hazel-c8oqh794d-napse-investment.vercel.app/'
const url = `${server}/update/${process.platform}/${app.getVersion()}`
// if (isProd) {
// const server = 'https://hazel-c8oqh794d-napse-investment.vercel.app/'
// const url = `${server}/update/${process.platform}/${app.getVersion()}`

autoUpdater.setFeedURL({ url })
setInterval(() => {
autoUpdater.checkForUpdates()
}, 60000)
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
const dialogOpts = {
type: 'info',
buttons: ['Restart', 'Later'],
title: 'Application Update',
message: process.platform === 'win32' ? releaseNotes : releaseName,
detail:
'A new version has been downloaded. Restart the application to apply the updates.'
}
// autoUpdater.setFeedURL({ url })
// setInterval(() => {
// autoUpdater.checkForUpdates()
// }, 60000)
// autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
// const dialogOpts = {
// type: 'info',
// buttons: ['Restart', 'Later'],
// title: 'Application Update',
// message: process.platform === 'win32' ? releaseNotes : releaseName,
// detail:
// 'A new version has been downloaded. Restart the application to apply the updates.'
// }

dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) autoUpdater.quitAndInstall()
})
console.log('update-downloaded')
})
autoUpdater.on('error', (message) => {
console.error('There was a problem updating the application')
console.error(message)
})
}
// dialog.showMessageBox(dialogOpts).then((returnValue) => {
// if (returnValue.response === 0) autoUpdater.quitAndInstall()
// })
// console.log('update-downloaded')
// })
// autoUpdater.on('error', (message) => {
// console.error('There was a problem updating the application')
// console.error(message)
// })
// }

const mainWindow = createWindow('main', {
width: 1000,
Expand Down
1 change: 1 addition & 0 deletions desktop-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"lint": "next lint"
},
"dependencies": {
"@babel/traverse": "^7.23.2",
"@aws-sdk/client-ec2": "^3.515.0",
"@aws-sdk/client-elastic-beanstalk": "^3.484.0",
"@aws-sdk/client-iam": "^3.485.0",
Expand Down
9 changes: 2 additions & 7 deletions desktop-app/renderer/pages/fleets/createFleetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default function CreateFleetDialog({
<DialogContent className="">
<Form {...form}>
<form
// onSubmit={form.handleSubmit(onSubmitFleet)}
onSubmit={form.handleSubmit(onSubmitFleet)}
className="space-y-2"
>
<Carousel className="">
Expand Down Expand Up @@ -223,12 +223,7 @@ export default function CreateFleetDialog({
clusters={Clusters}
setClusters={setClusters}
/>
<Button
type="submit"
onClick={form.handleSubmit(onSubmitFleet)}
>
Create
</Button>
<Button type="submit">Create</Button>
</div>
</CarouselItem>
</CarouselContent>
Expand Down
1 change: 1 addition & 0 deletions desktop-app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2491,6 +2491,7 @@
"@babel/parser" "^7.22.15"
"@babel/types" "^7.22.15"

"@babel/traverse@^7.23.0", "@babel/traverse@^7.23.2":
"@babel/traverse@^7.23.2":
version "7.23.2"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8"
Expand Down

0 comments on commit 9420404

Please sign in to comment.