Skip to content

Commit fe7ed26

Browse files
committed
Add Tauri
1 parent 892b96e commit fe7ed26

28 files changed

+11399
-31
lines changed

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'publish'
2+
on:
3+
push:
4+
branches:
5+
- release
6+
7+
jobs:
8+
publish-tauri:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
platform: [macos-latest, ubuntu-latest, windows-latest]
13+
14+
runs-on: ${{ matrix.platform }}
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: setup node
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: 12
21+
- name: install Rust stable
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: stable
25+
- name: install webkit2gtk (ubuntu only)
26+
if: matrix.platform == 'ubuntu-latest'
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y webkit2gtk-4.0
30+
- name: install app dependencies and build it
31+
run: yarn && yarn build
32+
- uses: tauri-apps/tauri-action@v0
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
37+
releaseName: 'App v__VERSION__'
38+
releaseBody: 'See the assets to download this version and install.'
39+
releaseDraft: true

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM oven/bun:1.2-alpine AS build
88
WORKDIR /app
99
COPY --from=deps /app/node_modules ./node_modules
1010
COPY . .
11-
ENV VITE_ABITTI_BUILD=true
11+
ENV VITE_DESKTOP_BUILD=true
1212
RUN apk add git && bun run build
1313

1414

bun.lock

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,36 @@
1313
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180">
1414
</head>
1515

16-
<body class="theme-dracula">
16+
<body style="background-color: var(--theme-background, #1d2d35)">
1717
<div id="app"></div>
1818
<script type="module" src="/src/main.tsx"></script>
1919
<script>
20-
window.addEventListener("appinstalled", () => {
21-
localStorage.setItem('pwa', 'true');
22-
window.resizeTo(500, 640);
23-
window.moveTo(
24-
Math.round((screen.width - 500) / 2),
25-
Math.round((screen.height - 640) / 2)
26-
)
27-
});
20+
if (!window.__TAURI__) {
21+
window.addEventListener("appinstalled", () => {
22+
localStorage.setItem('pwa', 'true');
23+
window.resizeTo(500, 640);
24+
window.moveTo(
25+
Math.round((screen.width - 500) / 2),
26+
Math.round((screen.height - 640) / 2)
27+
)
28+
});
2829

29-
let install = null;
30-
window.addEventListener('beforeinstallprompt', (ev) => {
31-
ev.preventDefault();
32-
install = ev;
33-
const prompt = document.querySelector('#pwa-install-prompt');
34-
if (prompt) {
35-
prompt.hidden = false;
36-
}
37-
});
30+
let install = null;
31+
window.addEventListener('beforeinstallprompt', (ev) => {
32+
ev.preventDefault();
33+
install = ev;
34+
const prompt = document.querySelector('#pwa-install-prompt');
35+
if (prompt) {
36+
prompt.hidden = false;
37+
}
38+
});
3839

39-
async function installPWA() {
40-
if (install !== null) {
41-
const res = await install.prompt();
40+
async function installPWA() {
41+
if (install !== null) {
42+
const res = await install.prompt();
43+
}
44+
document.querySelector('#pwa-install-prompt').hidden = true;
4245
}
43-
document.querySelector('#pwa-install-prompt').hidden = true;
4446
}
4547
</script>
4648
<script defer data-domain="kalkki.raikas.dev" src="https://plausible.mikroni.fi/js/script.js"></script>

0 commit comments

Comments
 (0)