Skip to content

Commit

Permalink
fix installation binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
0-don committed Dec 24, 2024
1 parent 8273b1d commit 853f971
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 73 deletions.
82 changes: 22 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ concurrency:
cancel-in-progress: true
env:
ARCH: x86_64
DEPENDENCIES_ARCH: "'libappindicator-gtk3' 'webkit2gtk' 'gtk3' 'xdotool'"
DEPENDENCIES_RPM: "javascriptcoregtk4.1, webkit2gtk4.1, libxdo, libappindicator-gtk3, xdotool"
DEPENDENCIES_ARCH: "'libappindicator-gtk3' 'webkit2gtk-4.1' 'gtk3' 'xdotool'"
jobs:
setup:
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
outputs:
name: ${{ steps.get-package.outputs.name }}
name_bin: ${{ steps.get-package.outputs.name }}-bin
Expand All @@ -24,7 +23,6 @@ jobs:
deb_pkg_path: ./src-tauri/target/release/bundle/deb/
deb_pkg_renamed: ${{ steps.get-package.outputs.name }}-${{ steps.get-package.outputs.version }}-${{ env.ARCH }}.deb
arch_pkg_name: ${{ steps.get-package.outputs.name }}-bin-${{ steps.get-package.outputs.version }}-1-${{ env.ARCH }}.pkg.tar.zst
rpm_pkg_name: RPMS/${{ steps.get-package.outputs.name }}-${{ steps.get-package.outputs.version }}-1.${{ env.ARCH }}.rpm
tag_name: v${{ steps.get-package.outputs.version }}
steps:
- uses: actions/checkout@v4
Expand All @@ -39,7 +37,6 @@ jobs:
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
echo "description=$(node -p "require('./package.json').description")" >> $GITHUB_OUTPUT
echo "license=$(node -p "require('./package.json').license")" >> $GITHUB_OUTPUT
build-tauri:
needs: [setup]
Expand All @@ -49,17 +46,16 @@ jobs:
fail-fast: false
matrix:
include:
- platform: "macos-latest" # for Arm based macs (M1 and above).
- platform: "macos-latest"
args: "--target aarch64-apple-darwin"
- platform: "macos-latest" # for Intel based macs.
- platform: "macos-latest"
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-24.04" # for Tauri v1 you could replace this with ubuntu-20.04.
- platform: "ubuntu-22.04"
args: ""
- platform: "windows-latest"
args: ""
runs-on: ${{ matrix.platform }}
steps:

- uses: actions/checkout@v4

- name: setup node
Expand All @@ -70,23 +66,32 @@ jobs:
- name: install rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-24.04' # This must match the platform value defined above.
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libappindicator3-dev librsvg2-dev libxcb-shape0-dev libxcb-xfixes0-dev patchelf libxdo-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev
sudo apt-get install -y \
libglib2.0-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
patchelf \
libxdo3 \
libxdo-dev \
libjavascriptcoregtk-4.1-dev \
libwebkit2gtk-4.1-dev
- name: install frontend dependencies
run: yarn install

- name: Set NO_STRIP environment variable
if: matrix.platform == 'ubuntu-24.04' || matrix.platform == 'macos-latest'
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'macos-latest'
run: echo "NO_STRIP=true" >> $GITHUB_ENV


- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -97,9 +102,8 @@ jobs:
releaseDraft: false
prerelease: false


- name: copy deb package && create PKGBUILD file (ubuntu only)
if: matrix.platform == 'ubuntu-24.04'
if: matrix.platform == 'ubuntu-22.04'
run: |
mkdir -p ${{ needs.setup.outputs.name_bin }}
cp -fr ${{ needs.setup.outputs.deb_pkg_path }}${{ needs.setup.outputs.deb_pkg_name }} ${{ needs.setup.outputs.name_bin }}/${{ needs.setup.outputs.deb_pkg_renamed }}
Expand Down Expand Up @@ -127,57 +131,15 @@ jobs:
cat ${{ needs.setup.outputs.name_bin }}/PKGBUILD
- name: create arch package (ubuntu only)
if: matrix.platform == 'ubuntu-24.04'
if: matrix.platform == 'ubuntu-22.04'
uses: 2m/arch-pkgbuild-builder@v1.17
with:
debug: true
target: pkgbuild
pkgname: ${{ needs.setup.outputs.name_bin }}/

# - name: copy deb package && create rpm.spec file (ubuntu only)
# if: matrix.platform == 'ubuntu-24.04'
# run: |
# mkdir -p ${{ needs.setup.outputs.name_bin }}
# cp -fr ${{ needs.setup.outputs.deb_pkg_path }}/${{ needs.setup.outputs.deb_pkg_name }} ${{ needs.setup.outputs.name_bin }}/${{ needs.setup.outputs.deb_pkg_renamed }}
# cat <<EOF > ./${{ needs.setup.outputs.name_bin }}/rpm.spec
# Name: ${{ needs.setup.outputs.name }}
# Version: ${{ needs.setup.outputs.version }}
# BuildArch: ${{ env.ARCH }}
# Release: 1
# Summary: ${{ needs.setup.outputs.description }}
# Requires: ${{ env.DEPENDENCIES_RPM }}
# License: ${{ needs.setup.outputs.license }}
# Source0: ${{ needs.setup.outputs.deb_pkg_renamed }}

# %description
# ${{ needs.setup.outputs.description }}

# %prep
# ar x %{SOURCE0}

# %build
# rm -rf control.tar.gz
# tar xvf data.tar.gz

# %install
# cp -fr usr/ %{buildroot}

# %files
# %{_bindir}/${{ needs.setup.outputs.name }}
# /usr/share/applications/${{ needs.setup.outputs.name }}.desktop
# /usr/share/icons/hicolor/**/*
# EOF
# cat ${{ needs.setup.outputs.name_bin }}/rpm.spec

# - name: createa rpm package (ubuntu only)
# if: matrix.platform == 'ubuntu-24.04'
# uses: Antikythera/build-rpm@latest
# with:
# spec_file: ${{ needs.setup.outputs.name_bin }}/rpm.spec
# sources: ${{ needs.setup.outputs.name_bin }}/${{ needs.setup.outputs.deb_pkg_renamed }}

- name: upload arch && rpm release (ubuntu only)
if: matrix.platform == 'ubuntu-24.04'
if: matrix.platform == 'ubuntu-22.04'
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,21 @@
<img src="public/clippy-showcase.webp" alt="Logo" >
</p>
</p>
<!-- npx npm-check-updates -u -->
<!-- sea-orm-cli migrate fresh -v -d migration && sea-orm-cli generate entity -l -o ./entity/src --expanded-format --with-serde both -->

successor of [the electron clippy](https://github.com/0-don/clippy-ts)

### Features

- display/hide **ctrl+y** or **ctrl+d** (change in settings)
- type out clipboard **ctrl+b** (where pasting isn't allowed)
- images & text support
- keybinds for everything
- text, html, rtf, image, file support
- keybinds for everything & custom keybinds
- add favorite clipboards
- smart search for links, colors, images, hex
- instant search
- change database location
- change keyboard bindings
- smart search, for links, colors, images, hex, etc.
- change/sync database location
- dark mode / white mode
- multilanguage support
- display scale

### Prerequisites Development

Expand Down Expand Up @@ -63,3 +61,10 @@ Before you begin, ensure you have met the following requirements:
- Linux(x11) KDE Plasma (Disable Focus Stealing Prevention)
- Windows
- Mac (hotkeys needs to be changed in settings)

<!-- DEBIAN GNOME X11 -->
<!-- su - -->
<!-- usermod -aG sudo don -->
<!-- echo "disable wayland" && sudo nano /etc/gdm3/daemon.conf -->
<!-- sudo dpkg -i ./code_1.96.2-1734607745_amd64.deb -->
<!-- sudo apt install pkg-config libglib2.0-dev libwebkit2gtk-4.1-dev libgtk-3-dev libxdo-dev libayatana-appindicator3-dev librsvg2-dev -->
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"dev": "vite",
"build": "vite build",
"tauri": "cross-env NO_STRIP=true tauri",
"tauri:build": "cross-env NO_STRIP=true tauri build --verbose",
"d": "cross-env COLORBT_SHOW_HIDDEN=1 tauri dev",
"gen": "sea-orm-cli migrate refresh -v -d src-tauri/migration && sea-orm-cli generate entity -l -o src-tauri/entity/src --expanded-format --with-serde both",
"icon": "tauri icon"
Expand Down
10 changes: 5 additions & 5 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ color-backtrace = "0"
# strip = true

[package.metadata.generate-rpm.requires]
"webkit2gtk-4.1" = "*"
"libappindicator-gtk3" = "*"
"xdotool" = "*"
"gtk3" = "*"
"libxdo" = "*"
# "webkit2gtk-4.1" = "*"
# "libappindicator-gtk3" = "*"
# "xdotool" = "*"
# "gtk3" = "*"
# "libxdo" = "*"
4 changes: 4 additions & 0 deletions src/components/pages/app/clipboard/text-clipboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export const TextClipboard: Component<TextClipboardProps> = (props) => {
let data = props.data.text?.data;
let textType = props.data.text?.type as ClipboardTextType;

if (props.data.text?.data && props.data.html?.data) {
type = ClipboardType.Html;
data = props.data.text?.data;
}
if (!props.data.text?.data && props.data.html?.data) {
type = ClipboardType.Html;
data = props.data.html.data;
Expand Down

0 comments on commit 853f971

Please sign in to comment.