Skip to content

Commit

Permalink
#8: Allow multiple selection (#23)
Browse files Browse the repository at this point in the history
* Added Windows Builds

* Added Release Step To Release Workflow

* updated workflows

* linux fix

* added more supported file types

* removed outdated code

* added tags

* Revert for tag filter code

* Enabling devtools

* Quick Push

* added support for folders

* removed comment

* Added Drag And Drop

* added macos workflows

* new build script

* new build script fix

* added upload

* added build step

* fixed order

* upload macos

* new mac fix

* merge branch

---------

Co-authored-by: Kawsar Ahmed <[email protected]>
Co-authored-by: Kirill Taran <[email protected]>
  • Loading branch information
3 people authored Apr 9, 2024
1 parent 1926ecd commit 781bb20
Show file tree
Hide file tree
Showing 10 changed files with 477 additions and 180 deletions.
110 changes: 52 additions & 58 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,68 @@ env:
on: [push]

jobs:
build-linux:
runs-on: ubuntu-latest

build-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
settings:
- platform: 'macos-latest' # for Intel based macs.
args: '--target universal-apple-darwin'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.settings.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: setup node
uses: actions/setup-node@v4
with:
toolchain: stable
components: rustfmt, clippy
node-version: lts/*

- name: Setup Node.js
uses: actions/setup-node@v4
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
node-version: '20.x'
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.settings.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Install dependencies
- name: install dependencies (ubuntu only)
if: matrix.settings.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev \
webkit2gtk-4.0 javascriptcoregtk-4.1 libappindicator3-dev \
librsvg2-dev patchelf libdbus-1-dev \
pkg-config \
- name: Fetch Node.js Dependencies
run: yarn

- name: Build Release version
run: yarn tauri build

- name: Upload AppImage
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
- name: install frontend dependencies
run: yarn install

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.settings.args }}

- name: Upload Windows Build
uses: actions/upload-artifact@v4
if: matrix.settings.platform == 'windows-latest'
with:
name: ark-gallery-Windows.zip
path: ./src-tauri/target/release/bundle/
- name: Upload Linux AppImage
if: matrix.settings.platform == 'ubuntu-22.04'
uses: actions/upload-artifact@v4
with:
name: ark-gallery.AppImage
path: ./src-tauri/target/release/bundle/appimage/ark-gallery_*_amd64.AppImage

build-windows:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Install dependencies
run: |
choco install -y nodejs
- name: Fetch Node.js Dependencies
run: yarn

- name: Build Release version
run: yarn tauri build

- name: Upload App
uses: actions/upload-artifact@v2
- name: Upload MacOS App
if: matrix.settings.platform == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: ark-gallery-Windows.zip
path: ./src-tauri/target/release/bundle/
name: ark-gallery.app
path: ./src-tauri/target/release/bundle/macos/
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,40 @@ jobs:
with:
artifacts: './target/release/bundle/*.exe'
token: ${{ secrets.GITHUB_TOKEN }}
release-macos:
runs-on: macos-latest
environment: Development
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
components: rustfmt, clippy

- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '16.x'

- name: Install dependencies (adjust as needed)
run: brew install pkg-config openssl webkit2gtk gtk+3

- name: Fetch Node.js dependencies
run: yarn

- name: Build Release version
run: yarn tauri build

- name: Create Release Archive (adjust filename/compression if needed)
run: |
cd src-tauri/target/release/bundle
zip -r ark-gallery-macOS.zip .
- name: Release macOS App
uses: ncipollo/release-action@v1
with:
artifacts: './ark-gallery-macOS.zip'
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"type": "module",
"dependencies": {
"@sveltejs/adapter-vercel": "^5.1.0",
"@tauri-apps/api": "^1.5.3",
"bits-ui": "^0.16.0",
"clsx": "^2.1.0",
"lucide-svelte": "^0.316.0",
Expand Down
101 changes: 101 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ tauri-build = { version = "1.5.1", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.6.1", features = [] }
tauri = { version = "1.6.1", features = [
"protocol-asset",
"fs-read-file",
"fs-read-dir",
"dialog-open",
"devtools"
] }

[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
Expand Down
Loading

0 comments on commit 781bb20

Please sign in to comment.