From c399e00aa439f10156a55b91904fc115a74a9e62 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Thu, 8 Aug 2024 10:28:20 +0800 Subject: [PATCH] 0.2.2 --- .github/workflows/build.yml | 15 +++------ aur/mihomo-party-bin/PKGBUILD | 1 + aur/mihomo-party-electron-bin/PKGBUILD | 31 +++++++++++++++++++ .../mihomo-party.desktop | 10 ++++++ .../mihomo-party.install | 14 +++++++++ aur/mihomo-party-electron-bin/mihomo-party.sh | 12 +++++++ aur/mihomo-party-electron/PKGBUILD | 2 +- aur/mihomo-party-git/PKGBUILD | 2 +- aur/mihomo-party/PKGBUILD | 2 +- package.json | 2 +- 10 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 aur/mihomo-party-electron-bin/PKGBUILD create mode 100644 aur/mihomo-party-electron-bin/mihomo-party.desktop create mode 100644 aur/mihomo-party-electron-bin/mihomo-party.install create mode 100644 aur/mihomo-party-electron-bin/mihomo-party.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40911ce..251c9f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,12 +101,6 @@ jobs: dist/*.deb dist/*.rpm if-no-files-found: error - - name: Rename - if: startsWith(github.ref, 'refs/tags/v') && matrix.arch == 'x64' - run: mv dist/linux-unpacked/resources/app.asar dist/mihomo-party-linux-$(echo ${{ github.ref }} | tr -d 'refs/tags/v')-${{ matrix.arch }}.asar - - name: Rename - if: startsWith(github.ref, 'refs/tags/v') && matrix.arch == 'arm64' - run: mv dist/linux-arm64-unpacked/resources/app.asar dist/mihomo-party-linux-$(echo ${{ github.ref }} | tr -d 'refs/tags/v')-${{ matrix.arch }}.asar - name: Publish Release if: startsWith(github.ref, 'refs/tags/v') uses: softprops/action-gh-release@v2 @@ -114,7 +108,6 @@ jobs: files: | dist/*.deb dist/*.rpm - dist/*.asar token: ${{ secrets.GITHUB_TOKEN }} macos: @@ -169,6 +162,7 @@ jobs: fail-fast: false matrix: pkgname: + - mihomo-party-electron-bin - mihomo-party-electron - mihomo-party-bin - mihomo-party @@ -180,8 +174,7 @@ jobs: uses: actions/checkout@v4 - name: Update Version run: | - sed -i "s/pkgver=.*/pkgver=$(echo ${{ github.ref }} | tr -d 'refs/tags/v')/" aur/mihomo-party-bin/PKGBUILD - sed -i "s/pkgver=.*/pkgver=$(echo ${{ github.ref }} | tr -d 'refs/tags/v')/" aur/mihomo-party/PKGBUILD + sed -i "s/pkgver=.*/pkgver=$(echo ${{ github.ref }} | tr -d 'refs/tags/v')/" aur/${{ matrix.pkgname }}/PKGBUILD - name: Update Checksums if: matrix.pkgname == 'mihomo-party' || matrix.pkgname == 'mihomo-party-electron' run: | @@ -189,12 +182,14 @@ jobs: sed -i "s/sha256sums=.*/sha256sums=(\"$(sha256sum ./release.tar.gz | awk '{print $1}')\")/" aur/mihomo-party/PKGBUILD sed -i "s/sha256sums=.*/sha256sums=(\"$(sha256sum ./release.tar.gz | awk '{print $1}')\")/" aur/mihomo-party-electron/PKGBUILD - name: Update Checksums - if: ${{ matrix.pkgname == 'mihomo-party-bin' }} + if: matrix.pkgname == 'mihomo-party-bin' || matrix.pkgname == 'mihomo-party-electron-bin' run: | wget https://github.com/pompurin404/mihomo-party/releases/download/$(echo ${{ github.ref }} | tr -d 'refs/tags/')/mihomo-party-linux-$(echo ${{ github.ref }} | tr -d 'refs/tags/v')-amd64.deb -O amd64.deb wget https://github.com/pompurin404/mihomo-party/releases/download/$(echo ${{ github.ref }} | tr -d 'refs/tags/')/mihomo-party-linux-$(echo ${{ github.ref }} | tr -d 'refs/tags/v')-arm64.deb -O arm64.deb sed -i "s/sha256sums_x86_64=.*/sha256sums_x86_64=(\"$(sha256sum ./amd64.deb | awk '{print $1}')\")/" aur/mihomo-party-bin/PKGBUILD sed -i "s/sha256sums_aarch64=.*/sha256sums_aarch64=(\"$(sha256sum ./arm64.deb | awk '{print $1}')\")/" aur/mihomo-party-bin/PKGBUILD + sed -i "s/sha256sums_x86_64=.*/sha256sums_x86_64=(\"$(sha256sum ./amd64.deb | awk '{print $1}')\")/" aur/mihomo-party-electron-bin/PKGBUILD + sed -i "s/sha256sums_aarch64=.*/sha256sums_aarch64=(\"$(sha256sum ./arm64.deb | awk '{print $1}')\")/" aur/mihomo-party-electron-bin/PKGBUILD - name: Publish AUR package uses: KSXGitHub/github-actions-deploy-aur@v2.7.2 with: diff --git a/aur/mihomo-party-bin/PKGBUILD b/aur/mihomo-party-bin/PKGBUILD index 728c471..fbbe4ab 100644 --- a/aur/mihomo-party-bin/PKGBUILD +++ b/aur/mihomo-party-bin/PKGBUILD @@ -6,6 +6,7 @@ pkgdesc="Another Mihomo GUI." arch=('x86_64' 'aarch64') url="https://github.com/pompurin404/mihomo-party" license=('GPL3') +conflicts=("$_pkgname" "$_pkgname-git" "$_pkgname-electron" "$_pkgname-electron-bin") conflicts=("mihomo-party-git" 'mihomo-party') depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux-libs' 'libsecret') optdepends=('libappindicator-gtk3: Allow mihomo-party to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).') diff --git a/aur/mihomo-party-electron-bin/PKGBUILD b/aur/mihomo-party-electron-bin/PKGBUILD new file mode 100644 index 0000000..821afda --- /dev/null +++ b/aur/mihomo-party-electron-bin/PKGBUILD @@ -0,0 +1,31 @@ +pkgname=mihomo-party-electron-bin +_pkgname=mihomo-party +pkgver=0.2.2 +pkgrel=1 +pkgdesc="Another Mihomo GUI." +arch=('x86_64' 'aarch64') +url="https://github.com/pompurin404/mihomo-party" +license=('GPL3') +conflicts=("$_pkgname" "$_pkgname-git" "$_pkgname-bin" "$_pkgname-electron") +depends=('electron' 'gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux-libs' 'libsecret') +optdepends=('libappindicator-gtk3: Allow mihomo-party to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).') +makedepends=('asar') +install=$_pkgname.install +source_x86_64=("${_pkgname}-${pkgver}-x86_64.deb::${url}/releases/download/v${pkgver}/mihomo-party-linux-${pkgver}-amd64.deb") +source_aarch64=("${_pkgname}-${pkgver}-aarch64.deb::${url}/releases/download/v${pkgver}/mihomo-party-linux-${pkgver}-arm64.deb") +sha256sums_x86_64=("43f8b9a5818a722cdb8e5044d2a90993274860b0da96961e1a2652169539ce39") +sha256sums_aarch64=("18574fdeb01877a629aa52ac0175335ce27c83103db4fcb2f1ad69e3e42ee10f") +options=('!lto') + +package() { + bsdtar -xf data.tar.xz -C $srcdir + asar extract $srcdir/opt/mihomo-party/resources/app.asar ${pkgdir}/opt/mihomo-party + chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo + chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo-alpha + cd ${pkgdir}/../.. + install -Dm755 "${_pkgname}.sh" "${pkgdir}/usr/bin/${_pkgname}" + install -Dm644 "${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop" + install -Dm644 "$srcdir/opt/mihomo-party/resources/icon.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/${_pkgname}.png" + + chown -R root:root ${pkgdir} +} \ No newline at end of file diff --git a/aur/mihomo-party-electron-bin/mihomo-party.desktop b/aur/mihomo-party-electron-bin/mihomo-party.desktop new file mode 100644 index 0000000..1f82b0d --- /dev/null +++ b/aur/mihomo-party-electron-bin/mihomo-party.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=mihomo-party +Exec=mihomo-party %U +Terminal=false +Type=Application +Icon=mihomo-party +StartupWMClass=mihomo-party +MimeType=x-scheme-handler/clash;x-scheme-handler/mihomo; +Comment=Mihomo Party +Categories=Utility; diff --git a/aur/mihomo-party-electron-bin/mihomo-party.install b/aur/mihomo-party-electron-bin/mihomo-party.install new file mode 100644 index 0000000..218d794 --- /dev/null +++ b/aur/mihomo-party-electron-bin/mihomo-party.install @@ -0,0 +1,14 @@ +# Colored makepkg-like functions +note() { + printf "${_blue}==>${_yellow} NOTE:${_bold} %s${_all_off}\n" "$1" +} + +_all_off="$(tput sgr0)" +_bold="${_all_off}$(tput bold)" +_blue="${_bold}$(tput setaf 4)" +_yellow="${_bold}$(tput setaf 3)" + +post_install() { + note "Custom flags should be put directly in: ~/.config/mihomo-party-flags.conf" + note "The launcher is called: 'mihomo-party'" +} \ No newline at end of file diff --git a/aur/mihomo-party-electron-bin/mihomo-party.sh b/aur/mihomo-party-electron-bin/mihomo-party.sh new file mode 100644 index 0000000..f4ca383 --- /dev/null +++ b/aur/mihomo-party-electron-bin/mihomo-party.sh @@ -0,0 +1,12 @@ +#!/usr/bin/bash + +XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config} + +# Allow users to override command-line options +if [[ -f "${XDG_CONFIG_HOME}/mihomo-party-flags.conf" ]]; then + mapfile -t MIHOMO_PARTY_USER_FLAGS <<<"$(grep -v '^#' "${XDG_CONFIG_HOME}/mihomo-party-flags.conf")" + echo "User flags:" ${MIHOMO_PARTY_USER_FLAGS[@]} +fi + +# Launch +exec electron /opt/mihomo-party ${MIHOMO_PARTY_USER_FLAGS[@]} "$@" diff --git a/aur/mihomo-party-electron/PKGBUILD b/aur/mihomo-party-electron/PKGBUILD index 8c59694..6417097 100644 --- a/aur/mihomo-party-electron/PKGBUILD +++ b/aur/mihomo-party-electron/PKGBUILD @@ -6,7 +6,7 @@ pkgdesc="Another Mihomo GUI." arch=('x86_64' 'aarch64') url="https://github.com/pompurin404/mihomo-party" license=('GPL3') -conflicts=("mihomo-party-git" 'mihomo-party-bin' 'mihomo-party') +conflicts=("$_pkgname" "$_pkgname-git" "$_pkgname-bin" "$_pkgname-electron-bin") depends=('electron' 'gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux-libs' 'libsecret') optdepends=('libappindicator-gtk3: Allow mihomo-party to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).') makedepends=('nodejs' 'pnpm' 'libxcrypt-compat' 'asar') diff --git a/aur/mihomo-party-git/PKGBUILD b/aur/mihomo-party-git/PKGBUILD index 167d027..5dd1c88 100644 --- a/aur/mihomo-party-git/PKGBUILD +++ b/aur/mihomo-party-git/PKGBUILD @@ -6,7 +6,7 @@ pkgdesc="Another Mihomo GUI." arch=('x86_64' 'aarch64') url="https://github.com/pompurin404/mihomo-party" license=('GPL3') -conflicts=("mihomo-party" 'mihomo-party-bin') +conflicts=("$_pkgname" "$_pkgname-bin" "$_pkgname-electron" "$_pkgname-electron-bin") depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux-libs' 'libsecret') optdepends=('libappindicator-gtk3: Allow mihomo-party to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).') makedepends=('nodejs' 'pnpm' 'jq' 'libxcrypt-compat') diff --git a/aur/mihomo-party/PKGBUILD b/aur/mihomo-party/PKGBUILD index eafc07f..f372cd6 100644 --- a/aur/mihomo-party/PKGBUILD +++ b/aur/mihomo-party/PKGBUILD @@ -5,7 +5,7 @@ pkgdesc="Another Mihomo GUI." arch=('x86_64' 'aarch64') url="https://github.com/pompurin404/mihomo-party" license=('GPL3') -conflicts=("mihomo-party-git" 'mihomo-party-bin') +conflicts=("$pkgname-git" "$pkgname-bin" "$pkgname-electron" "$pkgname-electron-bin") depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux-libs' 'libsecret') optdepends=('libappindicator-gtk3: Allow mihomo-party to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).') makedepends=('nodejs' 'pnpm' 'libxcrypt-compat') diff --git a/package.json b/package.json index 83a0b1c..56cb46e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mihomo-party", - "version": "0.2.1", + "version": "0.2.2", "description": "Mihomo Party", "main": "./out/main/index.js", "author": "mihomo-party",