Skip to content

Commit

Permalink
Tauri v2 migration
Browse files Browse the repository at this point in the history
Issue #231
  • Loading branch information
qu1ck committed Jan 27, 2025
1 parent 28fbe22 commit 07907e3
Show file tree
Hide file tree
Showing 27 changed files with 6,900 additions and 12,948 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
rust_target: aarch64-apple-darwin
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
- os: windows-latest
rust_target: aarch64-pc-windows-msvc

runs-on: ${{ matrix.platform.os }}
steps:
Expand All @@ -59,12 +61,8 @@ jobs:
cache: 'npm'

- name: 'Setup Rust'
if: matrix.platform.rust_target == 'aarch64-apple-darwin'
run: rustup target add aarch64-apple-darwin

- name: "Setup Rust"
if: matrix.platform.rust_target == 'x86_64-apple-darwin'
run: rustup target add x86_64-apple-darwin
if: matrix.platform.rust_target == 'aarch64-apple-darwin' || matrix.platform.rust_target == 'x86_64-apple-darwin' || matrix.platform.rust_target == 'aarch64-pc-windows-msvc'
run: rustup target add ${{matrix.platform.rust_target}}

- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -76,26 +74,38 @@ jobs:
if: matrix.platform.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libasound2-dev libfontconfig-dev
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev libfontconfig-dev
- name: install npm packages
run: npm ci

- uses: JonasKruckenberg/tauri-build@v1
- uses: tauri-apps/tauri-action@v0
id: tauri_build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target: ${{ matrix.platform.rust_target }}
args: --target ${{ matrix.platform.rust_target }}

# - uses: JonasKruckenberg/tauri-build@v1
# id: tauri_build
# with:
# projectPath: '.'
# runner: npm run
# args: --
# target: ${{ matrix.platform.rust_target }}

- name: Git status and version
run: |
git status
git describe --tags --dirty --always
git diff
echo ${{ steps.tauri_build.outputs.artifactPaths }}
# The artifacts output can now be used to upload the artifacts
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.rust_target }}
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}"
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifactPaths), '\n') }}"

- name: pack webapp
if: matrix.platform.os == 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: |
mkdir -p dist
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libasound2-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1 libappindicator3-dev librsvg2-dev patchelf libasound2-dev
touch src-tauri/dbip.mmdb
- uses: sksat/action-clippy@main
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Transmission v2.40 or later is required.

Prerequisites:
- [Node.js 16](https://nodejs.org/) or later
- [rust 1.70](https://www.rust-lang.org/) or later
- [rust 1.77](https://www.rust-lang.org/) or later
- Geoip lookup database in mmdb format, put it in `src-tauri`
```
wget -nv -O src-tauri/dbip.mmdb "https://github.com/openscopeproject/TrguiNG/releases/latest/download/dbip.mmdb"
Expand Down
10 changes: 7 additions & 3 deletions ci/generate_pkgbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@

VERSION = REF[len("refs/tags/v"):]

with subprocess.Popen(["sha256sum", "dbip.mmdb"], stdout=subprocess.PIPE) as proc:
with subprocess.Popen(
["sha256sum", "dbip.mmdb"],
stdout=subprocess.PIPE) as proc:
DBIP_SHA = proc.stdout.read().decode()[:64]
with subprocess.Popen(["sha256sum", "TrguiNG.desktop"], stdout=subprocess.PIPE) as proc:
with subprocess.Popen(
["sha256sum", "TrguiNG.desktop"],
stdout=subprocess.PIPE) as proc:
DESKTOP_SHA = proc.stdout.read().decode()[:64]


Expand All @@ -30,7 +34,7 @@
arch=('x86_64')
license=('AGPL-3.0')
depends=('alsa-lib' 'cairo' 'desktop-file-utils' 'fontconfig' 'gdk-pixbuf2' 'glib2' 'gtk3' 'hicolor-icon-theme' 'libayatana-appindicator' 'libsoup' 'openssl' 'webkit2gtk')
makedepends=('rust>=1.70.0' 'nodejs>=16.0.0' 'npm' 'git')
makedepends=('rust>=1.77.2' 'nodejs>=16.0.0' 'npm' 'git')
conflicts=('trgui-ng-git' 'trgui-ng-bin')
source=("git+https://github.com/openscopeproject/TrguiNG#tag=v$pkgver"
"https://github.com/openscopeproject/TrguiNG/releases/download/v$pkgver/dbip.mmdb"
Expand Down
Loading

0 comments on commit 07907e3

Please sign in to comment.