From 1b3d7b9ac1d1c3ca2fe733a63c15e8059ba47598 Mon Sep 17 00:00:00 2001 From: Luigi311 Date: Tue, 8 Aug 2023 00:07:52 -0600 Subject: [PATCH] Update for new maintainer Signed-off-by: Luigi311 --- .github/workflows/ci.yml | 389 ++++++++++++++++++ .github/workflows/master.yml | 246 ----------- .github/workflows/release-cli.yml | 57 --- .github/workflows/release.yml | 281 ------------- Cargo.lock | 2 +- Dockerfile | 8 +- README.md | 10 +- crates/tanoshi-cli/Cargo.toml | 2 +- crates/tanoshi-lib/Cargo.toml | 2 +- crates/tanoshi-util/Cargo.toml | 2 +- crates/tanoshi-vm/Cargo.toml | 2 +- crates/tanoshi-web/Cargo.toml | 2 +- crates/tanoshi-web/index.html | 2 +- crates/tanoshi-web/src/settings.rs | 6 +- crates/tanoshi/Cargo.toml | 4 +- crates/tanoshi/src-tauri/tauri.conf.json | 2 +- .../tanoshi/src/application/worker/updates.rs | 2 +- crates/tanoshi/src/infrastructure/config.rs | 2 +- docker-compose.yaml | 2 +- 19 files changed, 416 insertions(+), 607 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/master.yml delete mode 100644 .github/workflows/release-cli.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..0918867c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,389 @@ +name: test + +on: + workflow_dispatch: + pull_request: + paths-ignore: + - .gitignore + - "*.md" + - ".github/screenshots/**" + push: + paths-ignore: + - .gitignore + - "*.md" + - ".github/screenshots/**" + +env: + TRUNK_VERSION: 0.16.0 + RUST_TOOLCHAIN: 1.69.0 + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + steps: + - uses: actions/checkout@v3 + + - run: mkdir crates/tanoshi-web/dist + + - name: Install deps (ubuntu) + if: ${{ matrix.os == 'ubuntu-latest' }} + run: sudo apt update && sudo apt upgrade -y && sudo apt install -y libssl-dev libarchive-dev build-essential cmake llvm clang libicu-dev nettle-dev libacl1-dev liblzma-dev libzstd-dev liblz4-dev libbz2-dev zlib1g-dev libxml2-dev lsb-release wget software-properties-common libwebkit2gtk-4.0-dev curl libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libpango1.0-dev + + - name: Install deps (macos) + if: ${{ matrix.os == 'macos-latest' }} + run: brew install icu4c libarchive bzip2 lz4 zlib expat llvm@13 libiconv + + - id: cache-vcpkg + name: Cache vcpkg (windows) + uses: actions/cache@v3 + if: ${{ matrix.os == 'windows-latest' }} + with: + path: "C:/vcpkg/installed" + key: vcpkg-${{ matrix.os }}- + restore-keys: | + vcpkg-${{ matrix.os }}- + + - name: Install deps (windows) + if: ${{ matrix.os == 'windows-latest' }} + run: | + vcpkg integrate install + vcpkg install --only-downloads libarchive:x64-windows-static-md + vcpkg install libarchive:x64-windows-static-md + + - name: Install LLVM and Clang (ubuntu) + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: KyleMayes/install-llvm-action@v1 + with: + version: 13.0 + + - name: Install LLVM and Clang (windows) + if: ${{ matrix.os == 'windows-latest' }} + run: | + Invoke-WebRequest -Uri https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/LLVM-13.0.0-win64.exe -OutFile LLVM-13.0.0-win64.exe + 7z x .\LLVM-13.0.0-win64.exe -aoa -o'C:\Program Files\LLVM' + + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - uses: Swatinem/rust-cache@v2 + + - name: Test (ubuntu) + if: ${{ matrix.os == 'ubuntu-latest' }} + env: + RUSTFLAGS: "-Clink-arg=-Wl,--allow-multiple-definition" + run: cargo test + + - name: Test (macos) + if: ${{ matrix.os == 'macos-latest' }} + env: + PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig + run: cargo test + + - name: Test (windows) + if: ${{ matrix.os == 'windows-latest' }} + env: + LIBCLANG_PATH: C:\Program Files\LLVM\bin + run: cargo test + + build-web: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + target: wasm32-unknown-unknown + + - uses: Swatinem/rust-cache@v2 + + - name: Build tanoshi-web + run: | + cargo install trunk --version ${{ env.TRUNK_VERSION }} --locked + cd crates/tanoshi-web && trunk build --release + + - name: Upload tanoshi-web + uses: actions/upload-artifact@v3 + with: + name: tanoshi-web + path: crates/tanoshi-web/dist + + build-desktop: + runs-on: ${{ matrix.os }} + needs: + - build-web + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + steps: + - uses: actions/checkout@v3 + + - name: Download dist + uses: actions/download-artifact@v3 + with: + name: tanoshi-web + path: crates/tanoshi-web/dist + + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - uses: Swatinem/rust-cache@v2 + + - name: Install tauri-cli + run: cargo install tauri-cli --version ^1.0.0-rc --locked + + - name: Install deps + if: ${{ matrix.os == 'ubuntu-latest' }} + run: sudo apt update && sudo apt upgrade -y && sudo apt install -y libssl-dev libarchive-dev build-essential cmake llvm clang libicu-dev nettle-dev libacl1-dev liblzma-dev libzstd-dev liblz4-dev libbz2-dev zlib1g-dev libxml2-dev lsb-release wget software-properties-common libwebkit2gtk-4.0-dev curl libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libpango1.0-dev + + - name: Install deps + if: ${{ matrix.os == 'macos-latest' }} + run: brew install icu4c libarchive bzip2 lz4 zlib expat llvm@13 libiconv + + - name: Install LLVM and Clang + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: KyleMayes/install-llvm-action@v1 + with: + version: 13.0 + + - name: Install LLVM and Clang + if: ${{ matrix.os == 'windows-latest' }} + run: | + Invoke-WebRequest -Uri https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/LLVM-13.0.0-win64.exe -OutFile LLVM-13.0.0-win64.exe + 7z x .\LLVM-13.0.0-win64.exe -aoa -o'C:\Program Files\LLVM' + + - name: Cache vcpkg + uses: actions/cache@v3 + if: ${{ matrix.os == 'windows-latest' }} + with: + path: "C:/vcpkg/installed" + key: vcpkg-${{ matrix.os }}- + restore-keys: | + vcpkg-${{ matrix.os }}- + + - name: Install deps + if: ${{ matrix.os == 'windows-latest' }} + run: | + vcpkg integrate install + vcpkg install --only-downloads libarchive:x64-windows-static-md + vcpkg install libarchive:x64-windows-static-md + + - name: Build tanoshi (ubuntu) + if: ${{ matrix.os == 'ubuntu-latest' }} + env: + RUSTFLAGS: "-Clink-arg=-Wl,--allow-multiple-definition" + run: | + cd crates/tanoshi + cargo tauri build + + - name: Build tanoshi (macos) + if: ${{ matrix.os == 'macos-latest' }} + env: + PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig + run: | + cd crates/tanoshi + cargo tauri build + + - name: Build tanoshi (windows) + if: ${{ matrix.os == 'windows-latest' }} + run: | + cd crates/tanoshi + cargo tauri build + + - name: Upload dist (ubuntu) + uses: actions/upload-artifact@v3 + if: ${{ matrix.os == 'ubuntu-latest' }} + with: + name: tanoshi-desktop + path: | + target/release/bundle/**/*.deb + target/release/bundle/**/*.AppImage + !target/release/bundle/**/linuxdeploy-x86_64.AppImage + + - name: Upload dist (macos) + uses: actions/upload-artifact@v3 + if: ${{ matrix.os == 'macos-latest' }} + with: + name: tanoshi-desktop + path: target/release/bundle/**/*.dmg + + - name: Upload dist (windows) + uses: actions/upload-artifact@v3 + if: ${{ matrix.os == 'windows-latest' }} + with: + name: tanoshi-desktop + path: target/release/bundle/**/*.msi + + - name: Upload binaries to GitHub Releases + if: startsWith(github.ref, 'refs/tags/') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/bundle/**/* + tag: ${{ github.ref }} + + build-cli: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install deps + run: sudo apt update && sudo apt upgrade -y && sudo apt install -y libssl-dev libarchive-dev build-essential cmake libicu-dev nettle-dev libacl1-dev liblzma-dev libzstd-dev liblz4-dev libbz2-dev zlib1g-dev libxml2-dev lsb-release wget software-properties-common libwebkit2gtk-4.0-dev curl libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libpango1.0-dev + + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "13.0" + + - name: Install rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - name: Build tanoshi-cli + env: + RUSTFLAGS: "-Clink-arg=-Wl,--allow-multiple-definition" + LLVM_SYS_130_PREFIX: ${{ env.LLVM_PATH }} + run: | + cargo build -p tanoshi-cli --release + + - name: Copy artifact + run: | + mkdir ${{ github.workspace }}/artifact/ + cp ${{ github.workspace }}/target/release/tanoshi-cli ${{ github.workspace }}/artifact/ + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: tanoshi-cli + path: ${{ github.workspace }}/artifact/tanoshi-cli + + - name: Upload binaries to GitHub Releases + if: startsWith(github.ref, 'refs/tags/') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/tanoshi-cli + asset_name: tanoshi-cli + tag: ${{ github.ref }} + + build-docker: + runs-on: ubuntu-latest + needs: + - test + - build-web + strategy: + fail-fast: false + matrix: + include: + - dockerfile: Dockerfile + variant: slim + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Docker meta + id: docker_meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ secrets.DOCKER_USERNAME }}/tanoshi,enable=${{ secrets.DOCKER_USERNAME != '' }} + tags: | + type=raw,value=latest,enable=${{ matrix.variant == 'slim' && github.ref_name == github.event.repository.default_branch }} + type=raw,value=dev,enable=${{ matrix.variant == 'slim' && github.ref_name == 'dev' }} + type=raw,value=latest,suffix=-${{ matrix.variant }},enable={{ is_default_branch }} + type=ref,event=branch,suffix=-${{ matrix.variant }} + type=ref,event=pr,suffix=-${{ matrix.variant }} + type=semver,pattern={{ version }},suffix=-${{ matrix.variant }} + type=semver,pattern={{ major }}.{{ minor }},suffix=-${{ matrix.variant }} + type=sha,suffix=-${{ matrix.variant }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Append arm64 node to buildx + id: arm64 + env: + SSH_ARM64_HOST: ${{ secrets.SSH_ARM64_HOST }} + SSH_ARM64_PORT: ${{ secrets.SSH_ARM64_PORT }} + if: "${{ env.SSH_ARM64_HOST != '' }}" + run: | + mkdir -p ~/.ssh + chmod 700 ~/.ssh + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + if [ -z "$SSH_ARM64_PORT" ]; then + ssh-keyscan ${{ secrets.SSH_ARM64_HOST }} >> ~/.ssh/known_hosts + else + ssh-keyscan -p ${{ secrets.SSH_ARM64_PORT }} ${{ secrets.SSH_ARM64_HOST }} >> ~/.ssh/known_hosts + fi + chmod 644 ~/.ssh/known_hosts + + if [ -z "$SSH_ARM64_PORT" ]; then + docker context create node-arm64 --docker "host=ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }}" + else + docker context create node-arm64 --docker "host=ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }}:${{ secrets.SSH_ARM64_PORT }}" + fi + docker buildx create --append --name ${{ steps.buildx.outputs.name }} --platform linux/arm64 node-arm64 + + - name: Build platforms + run: | + # If arm64 was successfully appended, then we build for amd64 and arm64 + if [ -z "$SSH_ARM64_HOST" ]; then + echo "PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_ENV + else + echo "PLATFORMS=linux/amd64" >> $GITHUB_ENV + fi + + - name: Login to DockerHub + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + if: "${{ env.DOCKER_USERNAME != '' }}" + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Build + id: build + if: "${{ steps.docker_meta.outputs.tags == '' }}" + uses: docker/build-push-action@v4 + with: + context: . + file: ${{ matrix.dockerfile }} + platforms: ${{ env.PLATFORMS }} + push: false + tags: tanoshi:action + build-args: | + BUILD_WEB=false + cache-from: type=registry,ref=luigi311/tanoshi:buildcache + cache-to: type=registry,ref=luigi311/tanoshi:buildcache,mode=max + + - name: Build Push + id: build_push + if: "${{ steps.docker_meta.outputs.tags != '' }}" + uses: docker/build-push-action@v4 + with: + context: . + file: ${{ matrix.dockerfile }} + platforms: ${{ env.PLATFORMS }} + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + build-args: | + BUILD_WEB=false + cache-from: type=registry,ref=luigi311/tanoshi:buildcache + cache-to: type=registry,ref=luigi311/tanoshi:buildcache,mode=max diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml deleted file mode 100644 index 030ca15b..00000000 --- a/.github/workflows/master.yml +++ /dev/null @@ -1,246 +0,0 @@ -name: test - -on: - pull_request: - paths: - - crates/** - - "!**/*.md" - - "!.github/screenshots/**" - push: - branches: - - main - paths: - - .github/workflows/main.yml - - Dockerfile - - crates/** - - "!**/*.md" - - "!.github/screenshots/**" - -jobs: - build-docker: - if: ${{ github.ref == 'refs/heads/main' }} - runs-on: ubuntu-latest - environment: default - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - install: true - - name: Create ARM64 Context - run: | - mkdir -p ~/.ssh - chmod 700 ~/.ssh - echo "${{ secrets.ARM64_NODE_KEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan ${{ secrets.ARM64_NODE_HOST }} >> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts - docker context create node-arm64 --docker "host=ssh://${{ secrets.ARM64_NODE_USERNAME }}@${{ secrets.ARM64_NODE_HOST }}" - docker buildx create --append --name ${{ steps.buildx.outputs.name }} --platform linux/arm64 node-arm64 - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: faldez/tanoshi:master - build-args: | - BUILD_WEB=false - cache-from: type=registry,ref=faldez/tanoshi:buildcache - cache-to: type=registry,ref=faldez/tanoshi:buildcache,mode=max - build-web: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install trunk - run: | - wget -qO- https://github.com/thedodd/trunk/releases/download/v0.13.1/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- -C $HOME/.cargo/bin - chmod +x $HOME/.cargo/bin/trunk - - name: Install wasm32-unknown-unknown - run: rustup target add wasm32-unknown-unknown - - name: Build tanoshi-web - run: cd crates/tanoshi-web && trunk build --release - - name: Upload dist - uses: actions/upload-artifact@v2 - with: - name: dist - path: crates/tanoshi-web/dist - build-desktop: - runs-on: ${{ matrix.os }} - needs: - - build-web - strategy: - matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - steps: - - uses: actions/checkout@v2 - - name: Download dist - uses: actions/download-artifact@v2 - with: - name: dist - path: crates/tanoshi-web/dist - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.69.0 - override: true - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: install - args: tauri-cli --version ^1.0.0-rc --locked - - name: Install deps - if: ${{ matrix.os == 'ubuntu-latest' }} - run: sudo apt update && sudo apt upgrade -y && sudo apt install -y libssl-dev libarchive-dev build-essential cmake llvm clang libicu-dev nettle-dev libacl1-dev liblzma-dev libzstd-dev liblz4-dev libbz2-dev zlib1g-dev libxml2-dev lsb-release wget software-properties-common libwebkit2gtk-4.0-dev curl libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libpango1.0-dev - - name: Install deps - if: ${{ matrix.os == 'macos-latest' }} - run: brew install icu4c libarchive bzip2 lz4 zlib expat llvm@13 libiconv - - name: Install LLVM and Clang - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: KyleMayes/install-llvm-action@v1 - with: - version: 13.0 - - name: Install LLVM and Clang - if: ${{ matrix.os == 'windows-latest' }} - run: | - Invoke-WebRequest -Uri https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/LLVM-13.0.0-win64.exe -OutFile LLVM-13.0.0-win64.exe - 7z x .\LLVM-13.0.0-win64.exe -aoa -o'C:\Program Files\LLVM' - - name: Cache vcpkg - uses: actions/cache@v2 - if: ${{ matrix.os == 'windows-latest' }} - with: - path: "C:/vcpkg/installed" - key: vcpkg-${{ matrix.os }}- - restore-keys: | - vcpkg-${{ matrix.os }}- - - name: Install deps - if: ${{ matrix.os == 'windows-latest' }} - run: | - vcpkg integrate install - vcpkg install --only-downloads libarchive:x64-windows-static-md - vcpkg install libarchive:x64-windows-static-md - - name: Build tanoshi - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: marcopolo/cargo@master - with: - command: tauri - args: build - working-directory: crates/tanoshi - env: - RUSTFLAGS: "-Clink-arg=-Wl,--allow-multiple-definition" - - name: Build tanoshi - if: ${{ matrix.os == 'macos-latest' }} - uses: marcopolo/cargo@master - with: - command: tauri - args: build - working-directory: crates/tanoshi - env: - PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig - - name: Build tanoshi - if: ${{ matrix.os == 'windows-latest' }} - uses: marcopolo/cargo@master - with: - command: tauri - args: build - working-directory: crates/tanoshi - - name: Upload dist - uses: actions/upload-artifact@v2 - if: ${{ matrix.os == 'ubuntu-latest' }} - with: - name: tanoshi-desktop - path: | - target/release/bundle/**/*.deb - target/release/bundle/**/*.AppImage - !target/release/bundle/**/linuxdeploy-x86_64.AppImage - - name: Upload dist - uses: actions/upload-artifact@v2 - if: ${{ matrix.os == 'macos-latest' }} - with: - name: tanoshi-desktop - path: target/release/bundle/**/*.dmg - - name: Upload dist - uses: actions/upload-artifact@v2 - if: ${{ matrix.os == 'windows-latest' }} - with: - name: tanoshi-desktop - path: target/release/bundle/**/*.msi - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - steps: - - uses: actions/checkout@v2 - - run: mkdir crates/tanoshi-web/dist - - name: Install deps - if: ${{ matrix.os == 'ubuntu-latest' }} - run: sudo apt update && sudo apt upgrade -y && sudo apt install -y libssl-dev libarchive-dev build-essential cmake llvm clang libicu-dev nettle-dev libacl1-dev liblzma-dev libzstd-dev liblz4-dev libbz2-dev zlib1g-dev libxml2-dev lsb-release wget software-properties-common libwebkit2gtk-4.0-dev curl libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libpango1.0-dev - - name: Install deps - if: ${{ matrix.os == 'macos-latest' }} - run: brew install icu4c libarchive bzip2 lz4 zlib expat llvm@13 libiconv - - name: Install LLVM and Clang - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: KyleMayes/install-llvm-action@v1 - with: - version: 13.0 - - name: Install LLVM and Clang - if: ${{ matrix.os == 'windows-latest' }} - run: | - Invoke-WebRequest -Uri https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/LLVM-13.0.0-win64.exe -OutFile LLVM-13.0.0-win64.exe - 7z x .\LLVM-13.0.0-win64.exe -aoa -o'C:\Program Files\LLVM' - - id: cache-vcpkg - name: Cache vcpkg - uses: actions/cache@v2 - if: ${{ matrix.os == 'windows-latest' }} - with: - path: "C:/vcpkg/installed" - key: vcpkg-${{ matrix.os }}- - restore-keys: | - vcpkg-${{ matrix.os }}- - - name: Install deps - if: ${{ matrix.os == 'windows-latest' }} - run: | - vcpkg integrate install - vcpkg install --only-downloads libarchive:x64-windows-static-md - vcpkg install libarchive:x64-windows-static-md - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.69.0 - override: true - - uses: Swatinem/rust-cache@v1 - - name: Test - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: actions-rs/cargo@v1 - with: - command: test - env: - RUSTFLAGS: "-Clink-arg=-Wl,--allow-multiple-definition" - - name: Test - if: ${{ matrix.os == 'macos-latest' }} - uses: actions-rs/cargo@v1 - with: - command: test - env: - PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig - - name: Test - if: ${{ matrix.os == 'windows-latest' }} - uses: actions-rs/cargo@v1 - with: - command: test - env: - LIBCLANG_PATH: C:\Program Files\LLVM\bin diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml deleted file mode 100644 index 562cb6c9..00000000 --- a/.github/workflows/release-cli.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: release-cli - -on: - push: - tags: - - tanoshi-cli/v[0-9]+.[0-9]+.[0-9]+ - -jobs: - build: - runs-on: ubuntu-20.04 - environment: default - steps: - - uses: actions/checkout@v2 - - name: Set env - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV - - name: Install deps - run: sudo apt update && sudo apt upgrade -y && sudo apt install -y libssl-dev libarchive-dev build-essential cmake libicu-dev nettle-dev libacl1-dev liblzma-dev libzstd-dev liblz4-dev libbz2-dev zlib1g-dev libxml2-dev lsb-release wget software-properties-common libwebkit2gtk-4.0-dev curl libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libpango1.0-dev - - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 - with: - version: "13.0" - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.69.0 - override: true - - name: Build tanoshi-cli - uses: actions-rs/cargo@v1 - with: - command: build - args: -p tanoshi-cli --release - env: - RUSTFLAGS: "-Clink-arg=-Wl,--allow-multiple-definition" - LLVM_SYS_130_PREFIX: ${{ env.LLVM_PATH }} - - name: Copy artifact - run: | - mkdir ${{ github.workspace }}/artifact/ - cp ${{ github.workspace }}/target/release/tanoshi-cli ${{ github.workspace }}/artifact/ - - name: Upload Release Asset - uses: jakejarvis/s3-sync-action@master - env: - AWS_S3_BUCKET: tanoshi - AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }} - AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} - AWS_REGION: ${{ secrets.S3_REGION }} - SOURCE_DIR: ${{ github.workspace }}/artifact/ - DEST_DIR: tanoshi-cli/${{ env.RELEASE_VERSION }} - - name: Upload Release Asset - uses: jakejarvis/s3-sync-action@master - env: - AWS_S3_BUCKET: tanoshi - AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }} - AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} - AWS_REGION: ${{ secrets.S3_REGION }} - SOURCE_DIR: ${{ github.workspace }}/artifact/ - DEST_DIR: tanoshi-cli/latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index b4b55898..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,281 +0,0 @@ -name: release - -on: - push: - tags: - - v[0-9]+.[0-9]+.[0-9]+ - -jobs: - build-docker: - runs-on: ubuntu-latest - environment: default - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set env - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - install: true - - name: Create ARM64 Context - run: | - mkdir -p ~/.ssh - chmod 700 ~/.ssh - echo "${{ secrets.ARM64_NODE_KEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan ${{ secrets.ARM64_NODE_HOST }} >> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts - docker context create node-arm64 --docker "host=ssh://${{ secrets.ARM64_NODE_USERNAME }}@${{ secrets.ARM64_NODE_HOST }}" - docker buildx create --append --name ${{ steps.buildx.outputs.name }} --platform linux/arm64 node-arm64 - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: faldez/tanoshi:latest,faldez/tanoshi:${{ env.RELEASE_VERSION }} - build-args: | - BUILD_WEB=false - cache-from: type=registry,ref=faldez/tanoshi:buildcache - cache-to: type=registry,ref=faldez/tanoshi:buildcache,mode=max - build-web: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install trunk - run: | - wget -qO- https://github.com/thedodd/trunk/releases/download/v0.13.1/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- -C $HOME/.cargo/bin - chmod +x $HOME/.cargo/bin/trunk - - name: Install wasm32-unknown-unknown - run: rustup target add wasm32-unknown-unknown - - name: Build tanoshi-web - run: cd crates/tanoshi-web && trunk build --release - - name: Upload dist - uses: actions/upload-artifact@v2 - with: - name: dist - path: crates/tanoshi-web/dist - build-desktop: - runs-on: ${{ matrix.os }} - needs: - - build-web - strategy: - matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - include: - - os: macos-latest - asset_path: bundle/dmg/*.dmg - - os: windows-latest - asset_path: bundle/msi/*.msi - steps: - - uses: actions/checkout@v2 - - name: Download dist - uses: actions/download-artifact@v2 - with: - name: dist - path: crates/tanoshi-web/dist - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.69.0 - override: true - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: install - args: tauri-cli --version ^1.3.1 --locked - - name: Install deps - if: ${{ matrix.os == 'ubuntu-latest' }} - run: sudo apt update && sudo apt upgrade -y && sudo apt install -y libssl-dev libarchive-dev build-essential cmake llvm clang libicu-dev nettle-dev libacl1-dev liblzma-dev libzstd-dev liblz4-dev libbz2-dev zlib1g-dev libxml2-dev lsb-release wget software-properties-common libwebkit2gtk-4.0-dev curl libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libpango1.0-dev - - name: Install deps - if: ${{ matrix.os == 'macos-latest' }} - run: brew install icu4c libarchive bzip2 lz4 zlib expat llvm@13 libiconv - - name: Install LLVM and Clang - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: KyleMayes/install-llvm-action@v1 - with: - version: "13.0" - - name: Install LLVM and Clang - if: ${{ matrix.os == 'windows-latest' }} - run: | - Invoke-WebRequest -Uri https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/LLVM-11.0.1-win64.exe -OutFile LLVM-11.0.1-win64.exe - 7z x .\LLVM-11.0.1-win64.exe -aoa -o'C:\Program Files\LLVM' - - name: Cache vcpkg - uses: actions/cache@v2 - if: ${{ matrix.os == 'windows-latest' }} - with: - path: "C:/vcpkg/installed" - key: vcpkg-${{ matrix.os }}- - restore-keys: | - vcpkg-${{ matrix.os }}- - - name: Install deps - if: ${{ matrix.os == 'windows-latest' }} - run: | - vcpkg integrate install - vcpkg install --only-downloads libarchive:x64-windows-static-md - vcpkg install libarchive:x64-windows-static-md - - name: Build tanoshi - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: marcopolo/cargo@master - with: - command: tauri - args: build - working-directory: crates/tanoshi - env: - RUSTFLAGS: "-Clink-arg=-Wl,--allow-multiple-definition" - - name: Build tanoshi - if: ${{ matrix.os == 'macos-latest' }} - uses: marcopolo/cargo@master - with: - command: tauri - args: build - working-directory: crates/tanoshi - env: - PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig - - name: Build tanoshi - if: ${{ matrix.os == 'windows-latest' }} - uses: marcopolo/cargo@master - with: - command: tauri - args: build - working-directory: crates/tanoshi - env: - LIBCLANG_PATH: C:\Program Files\LLVM\bin - - name: Copy build - if: ${{ matrix.os == 'ubuntu-latest' }} - run: | - mkdir ${{ github.workspace }}/builds - cp target/release/bundle/**/*.deb target/release/bundle/**/*.AppImage builds/ - - name: Copy build - if: ${{ matrix.os != 'ubuntu-latest' }} - run: | - mkdir ${{ github.workspace }}/builds - cp ${{ github.workspace }}/target/release/${{ matrix.asset_path }} ${{ github.workspace }}/builds - - name: Upload build - uses: actions/upload-artifact@v3 - with: - name: builds - path: ${{ github.workspace }}/builds/ - build: - runs-on: ${{ matrix.os }} - needs: - - build-web - strategy: - matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - include: - - os: ubuntu-latest - filename: tanoshi - asset: tanoshi-linux - - os: macos-latest - filename: tanoshi - asset: tanoshi-macos - - os: windows-latest - filename: tanoshi.exe - asset: tanoshi-win.exe - steps: - - uses: actions/checkout@v2 - - name: Download dist - uses: actions/download-artifact@v2 - with: - name: dist - path: crates/tanoshi-web/dist - - name: Install deps - if: ${{ matrix.os == 'ubuntu-latest' }} - run: sudo apt update && sudo apt upgrade -y && sudo apt install -y libssl-dev libarchive-dev build-essential cmake llvm clang libicu-dev nettle-dev libacl1-dev liblzma-dev libzstd-dev liblz4-dev libbz2-dev zlib1g-dev libxml2-dev lsb-release wget software-properties-common libwebkit2gtk-4.0-dev curl libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libpango1.0-dev - - name: Install deps - if: ${{ matrix.os == 'macos-latest' }} - run: brew install icu4c libarchive bzip2 lz4 zlib expat llvm@13 libiconv - - name: Install LLVM and Clang - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: KyleMayes/install-llvm-action@v1 - with: - version: "13.0" - - name: Install LLVM and Clang - if: ${{ matrix.os == 'windows-latest' }} - run: | - Invoke-WebRequest -Uri https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/LLVM-13.0.0-win64.exe -OutFile LLVM-13.0.0-win64.exe - 7z x .\LLVM-13.0.0-win64.exe -aoa -o'C:\Program Files\LLVM' - - name: Cache vcpkg - uses: actions/cache@v2 - if: ${{ matrix.os == 'windows-latest' }} - with: - path: "C:/vcpkg/installed" - key: vcpkg-${{ matrix.os }}- - restore-keys: | - vcpkg-${{ matrix.os }}- - - name: Install deps - if: ${{ matrix.os == 'windows-latest' }} - run: | - vcpkg integrate install - vcpkg install --only-downloads libarchive:x64-windows-static-md - vcpkg install libarchive:x64-windows-static-md - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.69.0 - override: true - - uses: Swatinem/rust-cache@v1 - - name: Build tanoshi - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: actions-rs/cargo@v1 - with: - command: build - args: -p tanoshi --release - env: - RUSTFLAGS: "-Clink-arg=-Wl,--allow-multiple-definition" - - name: Build tanoshi - if: ${{ matrix.os == 'macos-latest' }} - uses: actions-rs/cargo@v1 - with: - command: build - args: -p tanoshi --release - env: - PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig - - name: Build tanoshi - if: ${{ matrix.os == 'windows-latest' }} - uses: actions-rs/cargo@v1 - with: - command: build - args: -p tanoshi --release - env: - LIBCLANG_PATH: C:\Program Files\LLVM\bin - - name: Copy build - run: cp ${{ github.workspace }}/target/release/${{ matrix.filename }} ${{ github.workspace }}/target/release/${{ matrix.asset }} - - name: Upload build - uses: actions/upload-artifact@v3 - with: - name: builds - path: ${{ github.workspace }}/target/release/${{ matrix.asset }} - create-release: - runs-on: ubuntu-latest - needs: - - build - - build-desktop - steps: - - uses: actions/checkout@v2 - - name: Download dist - uses: actions/download-artifact@v2 - with: - name: builds - path: builds - - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - run: git tag -l --format='%(contents)' ${{ env.RELEASE_VERSION }} > CHANGELOG-${{ env.RELEASE_VERSION }}.txt - - name: Create Release - id: create_release - uses: softprops/action-gh-release@v1 - with: - body_path: CHANGELOG-${{ env.RELEASE_VERSION }}.txt - name: Tanoshi ${{ env.RELEASE_VERSION }} - files: builds/** diff --git a/Cargo.lock b/Cargo.lock index b5a8afbf..85b53b7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1054,7 +1054,7 @@ dependencies = [ [[package]] name = "compress-tools" version = "0.14.3" -source = "git+https://github.com/faldez/compress-tools-rs#ff14670f1f6b0e2e606fc5f4f50412dc1e4e09f2" +source = "git+https://github.com/luigi311/compress-tools-rs#ff14670f1f6b0e2e606fc5f4f50412dc1e4e09f2" dependencies = [ "derive_more", "libc", diff --git a/Dockerfile b/Dockerfile index 5f6cb9cd..ac1720a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,14 @@ # Frontend planner -FROM faldez/tanoshi-builder:latest AS planner +FROM luigi311/tanoshi-builder:latest AS planner COPY . . RUN cargo chef prepare --recipe-path recipe.json + + # Backend builder -FROM faldez/tanoshi-builder:latest AS builder +FROM luigi311/tanoshi-builder:latest AS builder COPY --from=planner /app/recipe.json recipe.json RUN cargo chef cook --release --recipe-path recipe.json @@ -17,6 +19,8 @@ RUN cd crates/tanoshi-web && trunk build --release RUN cargo build -p tanoshi --release + + FROM debian:bookworm-slim AS runtime WORKDIR /app diff --git a/README.md b/README.md index e60aa68f..dce0473a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# ![icon](https://raw.githubusercontent.com/faldez/tanoshi/main/crates/tanoshi-web/static/icons/tanoshi.png) Tanoshi +# ![icon](https://raw.githubusercontent.com/luigi311/tanoshi/main/crates/tanoshi-web/static/icons/tanoshi.png) Tanoshi Selfhosted web manga reader. -![master](https://github.com/faldez/tanoshi/workflows/master/badge.svg) [![Release Stats](https://img.shields.io/github/downloads/faldez/tanoshi/total)](https://somsubhra.github.io/github-release-stats/?username=faldez&repository=tanoshi&page=1&per_page=5) [![Release](https://img.shields.io/github/v/release/faldez/tanoshi)](https://github.com/faldez/tanoshi/releases/latest) [![Docker Pulls](https://img.shields.io/docker/pulls/faldez/tanoshi)](https://hub.docker.com/repository/docker/faldez/tanoshi) [![Discord](https://img.shields.io/discord/872093374281285682?color=7289DA&logo=discord&logoColor=FFFFFF)](https://discord.gg/wPSEftdDqB) +![master](https://github.com/luigi311/tanoshi/workflows/master/badge.svg) [![Release Stats](https://img.shields.io/github/downloads/luigi311/tanoshi/total)](https://somsubhra.github.io/github-release-stats/?username=luigi311&repository=tanoshi&page=1&per_page=5) [![Release](https://img.shields.io/github/v/release/luigi311/tanoshi)](https://github.com/luigi311/tanoshi/releases/latest) [![Docker Pulls](https://img.shields.io/docker/pulls/luigi311/tanoshi)](https://hub.docker.com/repository/docker/luigi311/tanoshi) [![Discord](https://img.shields.io/discord/872093374281285682?color=7289DA&logo=discord&logoColor=FFFFFF)](https://discord.gg/wPSEftdDqB) ## Features - Browse, search, and read manga @@ -18,7 +18,7 @@ Selfhosted web manga reader. - MyAnimeList and AniList tracker support ## Download -Download from [release page](https://github.com/faldez/tanoshi/releases) or [docker](https://hub.docker.com/r/faldez/tanoshi). +Download from [release page](https://github.com/luigi311/tanoshi/releases) or [docker](https://hub.docker.com/r/luigi311/tanoshi). ### Desktop If you don't plan to host Tanoshi and use from single device you can download desktop version. Download `.msi` for windows, `.deb` or `.AppImage` for linux, `.dmg` for mac. @@ -27,7 +27,7 @@ If you don't plan to host Tanoshi and use from single device you can download de Go to [website](https://faldez.github.io/tanoshi) for documentation. ### Screenshot -Head over to [screenshots](https://faldez.github.io/tanoshi/screenshots/) section on website to see screenshot. +Head over to [screenshots](https://luigi311.github.io/tanoshi/screenshots/) section on website to see screenshot. ## Question -Create github issue or ask in [Discord](https://discord.gg/wPSEftdDqB) server +Create github issue or ask in Discussions. diff --git a/crates/tanoshi-cli/Cargo.toml b/crates/tanoshi-cli/Cargo.toml index ae3a1fd3..abe26efe 100644 --- a/crates/tanoshi-cli/Cargo.toml +++ b/crates/tanoshi-cli/Cargo.toml @@ -3,7 +3,7 @@ name = "tanoshi-cli" version = "0.7.0" edition = "2021" description = "Tanoshi CLI Utilities" -repository = "https://github.com/faldez/tanoshi" +repository = "https://github.com/luigi311/tanoshi" license = "MIT" readme = "README.md" exclude = [".github/*"] diff --git a/crates/tanoshi-lib/Cargo.toml b/crates/tanoshi-lib/Cargo.toml index 2cb4172b..051f7353 100644 --- a/crates/tanoshi-lib/Cargo.toml +++ b/crates/tanoshi-lib/Cargo.toml @@ -3,7 +3,7 @@ name = "tanoshi-lib" version = "0.27.0" edition = "2021" description = "Tanoshi library" -repository = "https://github.com/faldez/tanoshi" +repository = "https://github.com/luigi311/tanoshi" license = "MIT" readme = "README.md" exclude = [".github/*"] diff --git a/crates/tanoshi-util/Cargo.toml b/crates/tanoshi-util/Cargo.toml index 6735ec43..9fb73aaf 100644 --- a/crates/tanoshi-util/Cargo.toml +++ b/crates/tanoshi-util/Cargo.toml @@ -3,7 +3,7 @@ name = "tanoshi-util" version = "0.3.0" edition = "2021" description = "Tanoshi Utilities" -repository = "https://github.com/faldez/tanoshi" +repository = "https://github.com/luigi311/tanoshi" license = "MIT" readme = "README.md" exclude = [".github/*"] diff --git a/crates/tanoshi-vm/Cargo.toml b/crates/tanoshi-vm/Cargo.toml index 0887d302..6a879c4d 100644 --- a/crates/tanoshi-vm/Cargo.toml +++ b/crates/tanoshi-vm/Cargo.toml @@ -3,7 +3,7 @@ name = "tanoshi-vm" version = "0.7.2" edition = "2021" description = "Tanoshi VM" -repository = "https://github.com/faldez/tanoshi" +repository = "https://github.com/luigi311/tanoshi" license = "MIT" [dependencies] diff --git a/crates/tanoshi-web/Cargo.toml b/crates/tanoshi-web/Cargo.toml index 19d00f12..31ce8297 100644 --- a/crates/tanoshi-web/Cargo.toml +++ b/crates/tanoshi-web/Cargo.toml @@ -3,7 +3,7 @@ name = "tanoshi-web" version = "0.0.0" edition = "2021" description = "Tanoshi Web" -repository = "https://github.com/faldez/tanoshi" +repository = "https://github.com/luigi311/tanoshi" license = "MIT" [lib] diff --git a/crates/tanoshi-web/index.html b/crates/tanoshi-web/index.html index 21674411..bab3bdfd 100644 --- a/crates/tanoshi-web/index.html +++ b/crates/tanoshi-web/index.html @@ -28,7 +28,7 @@