Skip to content

Commit

Permalink
feat(tauri): updater window
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Nov 11, 2023
1 parent dd1bf65 commit 6670453
Show file tree
Hide file tree
Showing 42 changed files with 792 additions and 181 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/build-tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ jobs:
# The only real added benefit of NSIS is that the installer can have a custom logo.
# Also, nsis is the only one that currently works on arm64
# Another note is embedBootstrapper is enabled to improve support on window 7. Though windows 7 doesn't support arm64.
tauri_target: ["'aarch64-pc-windows-msvc --bundles nsis,updater'", "'x86_64-pc-windows-msvc --bundles msi,updater'"]
tauri_target:
[
"'aarch64-pc-windows-msvc --bundles nsis,updater'",
"'x86_64-pc-windows-msvc --bundles msi,updater'",
]

steps:
- uses: actions/checkout@v4
Expand All @@ -50,7 +54,7 @@ jobs:
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './app/tauri -> target'
workspaces: "./app/tauri -> target"
- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-22.04'
run: |
Expand Down Expand Up @@ -88,13 +92,23 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
# Download-artifact cannot do a wildcard and if all are downloaded it can download the results from the electron stage
# We could filter that but this is faster to avoid unneeded downloads.
- name: Download Win
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Display structure of downloaded files
shell: bash
run: ls -R
name: tauri-win
path: artifacts/tauri-win
- name: Download Mac
uses: actions/download-artifact@v3
with:
name: tauri-mac
path: artifacts/tauri-mac
- name: Download Linux
uses: actions/download-artifact@v3
with:
name: tauri-linux
path: artifacts/tauri-linux
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
Expand All @@ -106,4 +120,4 @@ jobs:
with:
name: tauri-release
path: |
release/*
release/*
54 changes: 29 additions & 25 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
needs: release-please
if: needs.release-please.outputs.release_created
uses: ./.github/workflows/build-tauri.yml
secrets: inherit
publish:
name: Publish
needs:
Expand Down Expand Up @@ -57,28 +58,31 @@ jobs:
built-*/*.exe
built-*/*.snap
built-*/*.blockmap
publish-to-homebrew-cask:
name: Publish to Homebrew Cask
needs:
- publish
- release-please
runs-on: macos-latest
steps:
- uses: Homebrew/actions/bump-packages@master
with:
casks: pomatez
token: ${{ secrets.GITHUB_TOKEN }}
publish-to-winget:
name: Publish to WinGet
needs:
- publish
- release-please
runs-on: windows-latest
steps:
- uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Zidoro.Pomatez
installers-regex: 'setup\.exe$'
max-versions-to-keep: 5 # keep only latest 5 versions
release-tag: ${{ needs.release-please.outputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}
tauri-release/*
# Commented out just for test releases
# publish-to-homebrew-cask:
# name: Publish to Homebrew Cask
# needs:
# - publish
# - release-please
# runs-on: macos-latest
# steps:
# - uses: Homebrew/actions/bump-packages@master
# with:
# casks: pomatez
# token: ${{ secrets.GITHUB_TOKEN }}
# publish-to-winget:
# name: Publish to WinGet
# needs:
# - publish
# - release-please
# runs-on: windows-latest
# steps:
# - uses: vedantmgoyal2009/winget-releaser@v2
# with:
# identifier: Zidoro.Pomatez
# installers-regex: 'setup\.exe$'
# max-versions-to-keep: 5 # keep only latest 5 versions
# release-tag: ${{ needs.release-please.outputs.tag }}
# token: ${{ secrets.GITHUB_TOKEN }}
30 changes: 0 additions & 30 deletions .github/workflows/test-build-thingy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.3.1"
".": "1.5.0"
}
65 changes: 61 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,70 @@
# Changelog

## [1.3.1](https://github.com/zidoro/pomatez/compare/v1.3.0...v1.3.1) (2023-10-19)
## [1.5.0](https://github.com/zidoro/pomatez/compare/v1.4.4...v1.5.0) (2023-11-11)

### Features ✨

- **tauri:** updater window ([b2345f9](https://github.com/zidoro/pomatez/commit/b2345f982c35daa8238ec76b74e81a223ee5cd46))

## [1.4.4](https://github.com/zidoro/pomatez/compare/v1.4.3...v1.4.4) (2023-11-08)

### Bug Fixes 🐛

- updater link name ([9ed38a0](https://github.com/zidoro/pomatez/commit/9ed38a0c471118d233c0d5b85e7419da1a0658d4))

## [1.4.3](https://github.com/zidoro/pomatez/compare/v1.4.2...v1.4.3) (2023-11-08)

### Bug Fixes 🐛

- artifacts downloading to the wrong location ([952b56a](https://github.com/zidoro/pomatez/commit/952b56a1ebcc9379a4f06786f65feeb3b95d2cbe))

## [1.4.2](https://github.com/zidoro/pomatez/compare/v1.4.1...v1.4.2) (2023-11-08)

### Bug Fixes 🐛

- release folder ([f427325](https://github.com/zidoro/pomatez/commit/f427325788f9e5236e5a0b1f3041c469f36d1941))

## [1.4.1](https://github.com/zidoro/pomatez/compare/v1.4.0...v1.4.1) (2023-11-08)

### Bug Fixes 🐛

- huge artifacts ([85cc2b6](https://github.com/zidoro/pomatez/commit/85cc2b606980ba4fce51cda7bdf06a98b8fd9587))

## [1.4.0](https://github.com/zidoro/pomatez/compare/v1.3.1...v1.4.0) (2023-11-08)

### Features ✨

- add base tauri app ([f1ee205](https://github.com/zidoro/pomatez/commit/f1ee205cf010e6403ef4781295c14c98a1978ee4))
- make tauri version draggable ([bf891c5](https://github.com/zidoro/pomatez/commit/bf891c5d7d2f4ca546943e7d1ebd68902973e33b))
- restructure connector in a way that allows easy switching out for platforms ([f4d8d77](https://github.com/zidoro/pomatez/commit/f4d8d7714781e72f13b36b2231d0b5a7fdf390a1))
- **tauri:** add base connector with placeholders for logging ([67cb272](https://github.com/zidoro/pomatez/commit/67cb272172337952f3c0f9e98554af45fab298c0))
- **tauri:** add closing logic ([f57caa0](https://github.com/zidoro/pomatez/commit/f57caa005debd0aa78271c5f639f117b65e092c3))
- **tauri:** add easy command interface for frontend -> backend ([69bab00](https://github.com/zidoro/pomatez/commit/69bab0008b962a81d7908a4f9118d30b060f02fb))
- **tauri:** add global show and hide shortcuts as well as block reload ([d17b63d](https://github.com/zidoro/pomatez/commit/d17b63d66abe19ef01a1dc000d1d6bdca7515611))
- **tauri:** add tray icon updating and a number of other commands ([dadf80f](https://github.com/zidoro/pomatez/commit/dadf80f2ec9b6e1860021a33c5d99da83b011601))
- **tauri:** added connection hooks for all of the base tauri commands ([a325e0b](https://github.com/zidoro/pomatez/commit/a325e0be081e1958a16760146baaa128cda85f13))
- **tauri:** always on top command ([f8c3cea](https://github.com/zidoro/pomatez/commit/f8c3cea292aae4bae75f9c07a7b54bd4fbf625ef))
- **tauri:** auto updater ([dd1bf65](https://github.com/zidoro/pomatez/commit/dd1bf652eeda0929cb1601c71ad5526f0c46f54d))
- **tauri:** compact mode resizing ([76ace97](https://github.com/zidoro/pomatez/commit/76ace97c75875d0e15bf67902fc6c366d554e52b))
- **tauri:** debug menu in dev mode ([f1f4fc2](https://github.com/zidoro/pomatez/commit/f1f4fc257b87a028a8d161a16de153c1ff5fb65e))
- **tauri:** full screen mode ([ba75f3d](https://github.com/zidoro/pomatez/commit/ba75f3dcdee4afae1d30295a58a302feacd0e921))
- **tauri:** improve installer ([0b3df63](https://github.com/zidoro/pomatez/commit/0b3df63371f4f323ea61e921ce1ca8734ce07cf6))
- **tauri:** pass the data from the frontend into the commands ([2e8faf9](https://github.com/zidoro/pomatez/commit/2e8faf9841d09db74e783b356d6ca14a94340ee6))

### Bug Fixes 🐛

- **tauri:** allow context menu on list titles ([efc7bd2](https://github.com/zidoro/pomatez/commit/efc7bd28623c75d7791d638f8779dc4ed868573b))
- **tauri:** catch audio playing errors gracefully ([90d662a](https://github.com/zidoro/pomatez/commit/90d662ab4a0cee61d6e3020ef4a465a18b49f272))
- **tauri:** fullscreen break being resizeable ([391f5b5](https://github.com/zidoro/pomatez/commit/391f5b51c397e82db72f7f2f11483f460c0f73cd))
- **tauri:** update to tauri v2 (fixes audio) ([8d5a273](https://github.com/zidoro/pomatez/commit/8d5a2739f0fd4e2b3da29b6330f07a66f472756f))

## [1.3.1](https://github.com/zidoro/pomatez/compare/v1.3.0...v1.3.1) (2023-10-19)

### Bug Fixes 🐛

* javascript error on launch ([#414](https://github.com/zidoro/pomatez/issues/414)) ([c6c18fb](https://github.com/zidoro/pomatez/commit/c6c18fb47b424be62a9b91ed64c7c95e8eaa41a3))
* **lang:** Switch "released notes" with "release notes" ([#439](https://github.com/zidoro/pomatez/issues/439)) ([d9a3afa](https://github.com/zidoro/pomatez/commit/d9a3afa11f828084483c1d1e3693ff9b0dc1c8e1))
* toast notification ([#382](https://github.com/zidoro/pomatez/issues/382)) ([25403d7](https://github.com/zidoro/pomatez/commit/25403d742d83d0d3654418a43bc5efe8316dc019))
- javascript error on launch ([#414](https://github.com/zidoro/pomatez/issues/414)) ([c6c18fb](https://github.com/zidoro/pomatez/commit/c6c18fb47b424be62a9b91ed64c7c95e8eaa41a3))
- **lang:** Switch "released notes" with "release notes" ([#439](https://github.com/zidoro/pomatez/issues/439)) ([d9a3afa](https://github.com/zidoro/pomatez/commit/d9a3afa11f828084483c1d1e3693ff9b0dc1c8e1))
- toast notification ([#382](https://github.com/zidoro/pomatez/issues/382)) ([25403d7](https://github.com/zidoro/pomatez/commit/25403d742d83d0d3654418a43bc5efe8316dc019))

## [1.3.0](https://github.com/zidoro/pomatez/compare/v1.2.3...v1.3.0) (2023-09-26)

Expand Down
2 changes: 1 addition & 1 deletion app/electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pomatez",
"version": "1.3.1",
"version": "1.5.0",
"private": true,
"license": "MIT",
"main": "./build/main.js",
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pomatez/renderer",
"version": "1.3.1",
"version": "1.5.0",
"private": true,
"license": "MIT",
"author": {
Expand Down
12 changes: 11 additions & 1 deletion app/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ export default function App() {
document.removeEventListener("contextmenu", contextEvent);
}, []);

useEffect(() => {
const middleMouseEvent = (event: MouseEvent) => {
if (event.button === 1) event.preventDefault();
};
window.addEventListener("auxclick", middleMouseEvent);

return () =>
window.removeEventListener("auxclick", middleMouseEvent);
}, []);

return (
<ThemeProvider>
<CounterProvider>
Expand All @@ -54,7 +64,7 @@ export default function App() {
/>
)
)
: routes.map(
: routes().map(
({ exact, path, component }, index) => (
<Route
exact={exact}
Expand Down
18 changes: 18 additions & 0 deletions app/renderer/src/components/NavNotify.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import styled from "styled-components/macro";

/**
* This is very roughly positioned atm though adding divs around the nav items breaks the layout
*/
const NavNotify: React.FC = styled.div`
background: var(--color-primary);
width: 8px;
height: 8px;
top: 0;
right: 0;
position: absolute;
transform: translate(50%, -50%);
border-radius: 50%;
`;

export default NavNotify;
39 changes: 25 additions & 14 deletions app/renderer/src/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {
StyledNavList,
StyledNavListItem,
StyledNavLink,
StyledNavIconWrapper,
} from "styles";
import { NavNotify } from "components";
import { routes } from "config";
import SVG from "./SVG";

Expand All @@ -19,23 +21,32 @@ const Navigation: React.FC<Props> = ({ timerType }) => {
(state: AppStateTypes) => state.settings
);

const state = useSelector((state: AppStateTypes) => state);

return (
<StyledNav useNativeTitlebar={settings.useNativeTitlebar}>
<StyledNavList>
{routes.map(({ name, icon, exact, path }, index) => (
<StyledNavListItem key={index}>
<StyledNavLink
exact={exact}
to={path}
type={timerType}
draggable="false"
replace
>
<SVG name={icon} />
{name}
</StyledNavLink>
</StyledNavListItem>
))}
{routes(state).map(
({ name, icon, exact, path, notify }, index) => {
return (
<StyledNavListItem key={index}>
<StyledNavLink
exact={exact}
to={path}
type={timerType}
draggable="false"
replace
>
<StyledNavIconWrapper>
<SVG name={icon} />
{notify && <NavNotify />}
</StyledNavIconWrapper>
{name}
</StyledNavLink>
</StyledNavListItem>
);
}
)}
</StyledNavList>
</StyledNav>
);
Expand Down
5 changes: 2 additions & 3 deletions app/renderer/src/components/Titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ type Props = {
};

const Titlebar: React.FC<Props> = ({ darkMode, timerType }) => {
const { onMinimizeCallback, onExitCallback } = useContext(
ConnnectorContext
);
const { onMinimizeCallback, onExitCallback } =
useContext(ConnnectorContext);

const getAppIcon = useCallback(() => {
switch (timerType) {
Expand Down
Loading

0 comments on commit 6670453

Please sign in to comment.