Skip to content

Commit 9457a6b

Browse files
committed
init
0 parents  commit 9457a6b

137 files changed

Lines changed: 14113 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yaml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: Build app.
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os:
15+
- ubuntu-latest
16+
- windows-latest
17+
node-version:
18+
- 22.x
19+
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: 🗄️ Setup Rust cache
24+
uses: actions/cache@v4
25+
with:
26+
key: ${{ matrix.os }}-${{ hashFiles('src-tauri/Cargo.lock') }}
27+
path: |
28+
~/.cargo/registry/index
29+
~/.cargo/registry/cache
30+
~/.cargo/git
31+
./src-tauri/target
32+
33+
- name: 🦀 Install Rust
34+
uses: actions-rs/toolchain@v1
35+
with: { toolchain: stable }
36+
37+
- name: 🌐 Update MSEdge webdriver (windowsonly)
38+
if: matrix.os == 'windows-latest'
39+
run: |
40+
choco upgrade microsoft-edge
41+
42+
- name: 🌐 Install webkit2gtk (ubuntu only)
43+
if: matrix.os == 'ubuntu-latest'
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get upgrade -y \
47+
libwebkit2gtk-4.1-dev \
48+
build-essential \
49+
curl \
50+
wget \
51+
file \
52+
libxdo-dev \
53+
libssl-dev \
54+
libayatana-appindicator3-dev \
55+
librsvg2-dev
56+
57+
- uses: pnpm/action-setup@v4
58+
with:
59+
version: 10
60+
cache: true
61+
62+
- name: 🟢 Use Node.js ${{ matrix.node-version }}
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version: ${{ matrix.node-version }}
66+
cache: 'pnpm'
67+
68+
- name: 🔌 Install Node.js dependencies
69+
run: pnpm install --frozen-lockfile
70+
71+
- name: 🔌 Download Rust dependencies
72+
working-directory: src-tauri
73+
run: cargo fetch
74+
75+
- name: 🏗️ 💽 Build application
76+
run: pnpm run tauri build
77+
78+
- name: 🧪 Test backend application
79+
continue-on-error: true
80+
working-directory: src-tauri
81+
run: |
82+
cargo test
83+
84+
- name: 🗃 Store Linux artifacts (release only)
85+
uses: actions/upload-artifact@v4
86+
if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/v')
87+
with:
88+
name: pos_sum_artifacts_${{ matrix.os }}
89+
overwrite: true
90+
path: |
91+
src-tauri/target/release/pos_sum
92+
src-tauri/target/release/bundle/deb/*.deb
93+
94+
- name: 🗃 Store Windows artifacts (release only)
95+
uses: actions/upload-artifact@v4
96+
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/v')
97+
with:
98+
name: pos_sum_artifacts_${{ matrix.os }}
99+
overwrite: true
100+
path: |
101+
src-tauri/target/release/pos_sum.exe
102+
src-tauri/target/release/bundle/msi/*.msi
103+
104+
release:
105+
runs-on: ubuntu-latest
106+
needs:
107+
- build
108+
if: startsWith(github.ref, 'refs/tags/v')
109+
steps:
110+
- uses: actions/checkout@v4
111+
112+
- name: Create release
113+
uses: softprops/action-gh-release@v2
114+
with:
115+
tag_name: ${{ github.ref_name }}
116+
token: ${{ secrets.GITHUB_TOKEN }}
117+
118+
- name: 🗃 Download built artifacts
119+
uses: actions/download-artifact@v4
120+
with:
121+
path: src-tauri/target/release
122+
merge-multiple: true
123+
124+
- name: Upload Windows executable
125+
uses: svenstaro/upload-release-action@v2
126+
with:
127+
repo_token: ${{ secrets.GITHUB_TOKEN }}
128+
file: src-tauri/target/release/pos_sum.exe
129+
asset_name: pos_sum_${{ github.ref_name }}.exe
130+
tag: ${{ github.ref_name }}
131+
overwrite: true
132+
file_glob: true
133+
134+
- name: Upload Windows installer
135+
uses: svenstaro/upload-release-action@v2
136+
with:
137+
repo_token: ${{ secrets.GITHUB_TOKEN }}
138+
file: src-tauri/target/release/bundle/msi/pos_sum_*.msi
139+
asset_name: pos_sum_${{ github.ref_name }}_installer.msi
140+
tag: ${{ github.ref_name }}
141+
overwrite: true
142+
file_glob: true
143+
144+
- name: Upload Linux executable
145+
uses: svenstaro/upload-release-action@v2
146+
with:
147+
repo_token: ${{ secrets.GITHUB_TOKEN }}
148+
file: src-tauri/target/release/pos_sum
149+
asset_name: pos_sum_${{ github.ref_name }}
150+
tag: ${{ github.ref_name }}
151+
overwrite: true
152+
file_glob: true
153+
154+
- name: Upload Linux deb package
155+
uses: svenstaro/upload-release-action@v2
156+
with:
157+
repo_token: ${{ secrets.GITHUB_TOKEN }}
158+
file: src-tauri/target/release/bundle/deb/pos_sum_*.deb
159+
asset_name: pos_sum_${{ github.ref_name }}.deb
160+
tag: ${{ github.ref_name }}
161+
overwrite: true
162+
file_glob: true

.github/workflows/release.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: 'publish'
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-tauri:
9+
permissions:
10+
contents: write
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- platform: 'macos-latest' # for Arm based macs (M1 and above).
16+
args: '--target aarch64-apple-darwin'
17+
mobile: ''
18+
- platform: 'macos-latest' # for Intel based macs.
19+
args: '--target x86_64-apple-darwin'
20+
mobile: ''
21+
- platform: 'ubuntu-22.04'
22+
args: ''
23+
mobile: ''
24+
- platform: 'windows-latest'
25+
args: ''
26+
mobile: ''
27+
- platform: 'ubuntu-22.04'
28+
args: ''
29+
mobile: 'android'
30+
31+
runs-on: ${{ matrix.platform }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: setup node
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: lts/*
39+
40+
- name: install Rust stable
41+
uses: dtolnay/rust-toolchain@stable
42+
with:
43+
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
44+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
45+
46+
- name: install dependencies (ubuntu only)
47+
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
51+
52+
- name: Install Android dependencies (if applicable)
53+
uses: actions/setup-java@v5
54+
if: matrix.mobile == 'android'
55+
with:
56+
distribution: 'zulu' # See 'Supported distributions' for available options
57+
java-version: '21'
58+
59+
- name: 🟢 Install Node.js
60+
uses: actions/setup-node@v6
61+
with:
62+
node-version: 22
63+
package-manager-cache: pnpm
64+
65+
- name: 📦 Install package manager
66+
run: npm i -g pnpm
67+
68+
- name: 🔌 Install Node.js dependencies
69+
run: pnpm install --frozen-lockfile
70+
71+
- name: Write release-name
72+
run: echo "${{ github.ref_name }}" > release-name
73+
74+
- name: setup Android signing
75+
if: matrix.mobile == 'android'
76+
run: |
77+
cd src-tauri/gen/android
78+
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
79+
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
80+
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
81+
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
82+
83+
- name: 'Build binary'
84+
uses: tauri-apps/tauri-action@44a5bf1eaeeebdabfd8951645f567c83b0ae02a3
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
with:
88+
tagName: ${{ github.ref_name }}
89+
releaseName: ${{ github.ref_name }}
90+
releaseBody: 'See the assets below to download the installer for your platform.'
91+
releaseDraft: false
92+
prerelease: true
93+
uploadPlainBinary: true
94+
mobile: ${{ matrix.mobile }}
95+
args: ${{ matrix.args }}

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
vite.config.js.timestamp-*
10+
vite.config.ts.timestamp-*
11+
release-name
12+
.localdev/keystore.properties

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock
5+
bun.lock
6+
bun.lockb
7+
8+
# Miscellaneous
9+
/static/
10+
/src-tauri/

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
15+
}

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"svelte.svelte-vscode",
4+
"tauri-apps.tauri-vscode",
5+
"rust-lang.rust-analyzer",
6+
"esbenp.prettier-vscode"
7+
]
8+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"svelte.enable-ts-plugin": true
3+
}

0 commit comments

Comments
 (0)