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 186d28c
Show file tree
Hide file tree
Showing 42 changed files with 734 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"
}
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

## [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 186d28c

Please sign in to comment.