release: v2.11.1 #43
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| pypi_publish: | |
| name: Upload release to PyPI | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/weeb-cli | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| attestations: false | |
| build_binaries: | |
| name: Build Binaries | |
| needs: pypi_publish | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| arch: x64 | |
| artifact_name: weeb-cli-Linux-x86_64 | |
| binary_name: weeb-cli | |
| - os: windows-latest | |
| arch: x64 | |
| artifact_name: weeb-cli-Windows-x86_64.exe | |
| binary_name: weeb-cli.exe | |
| - os: windows-latest | |
| arch: x86 | |
| artifact_name: weeb-cli-Windows-x86.exe | |
| binary_name: weeb-cli.exe | |
| - os: macos-13 | |
| arch: x64 | |
| artifact_name: weeb-cli-macOS-x86_64 | |
| binary_name: weeb-cli | |
| - os: macos-latest | |
| arch: arm64 | |
| artifact_name: weeb-cli-macOS-arm64 | |
| binary_name: weeb-cli | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| architecture: ${{ matrix.arch }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| pip install -e . | |
| - name: Ensure data directories exist | |
| shell: bash | |
| run: | | |
| mkdir -p weeb_cli/locales | |
| mkdir -p weeb_cli/templates | |
| - name: Build with PyInstaller | |
| shell: bash | |
| run: | | |
| if [ "${{ runner.os }}" = "Windows" ]; then | |
| SEP=";" | |
| else | |
| SEP=":" | |
| fi | |
| pyinstaller --name weeb-cli --onefile --clean --noconfirm \ | |
| --add-data "weeb_cli/locales${SEP}weeb_cli/locales" \ | |
| --add-data "weeb_cli/templates${SEP}weeb_cli/templates" \ | |
| --hidden-import weeb_cli.commands.api \ | |
| --hidden-import weeb_cli.commands.downloads \ | |
| --hidden-import weeb_cli.commands.library \ | |
| --hidden-import weeb_cli.commands.search \ | |
| --hidden-import weeb_cli.commands.serve \ | |
| --hidden-import weeb_cli.commands.settings \ | |
| --hidden-import weeb_cli.commands.setup \ | |
| --hidden-import weeb_cli.commands.watchlist \ | |
| --hidden-import weeb_cli.providers.tr.animecix \ | |
| --hidden-import weeb_cli.providers.tr.turkanime \ | |
| --hidden-import weeb_cli.providers.tr.anizle \ | |
| --hidden-import weeb_cli.providers.tr.weeb \ | |
| --hidden-import weeb_cli.providers.en.hianime \ | |
| --hidden-import weeb_cli.providers.en.allanime \ | |
| --hidden-import weeb_cli.providers.de.aniworld \ | |
| --copy-metadata typer \ | |
| --copy-metadata rich \ | |
| --copy-metadata questionary \ | |
| weeb_cli/__main__.py | |
| - name: Rename Binary | |
| shell: bash | |
| run: | | |
| mv dist/${{ matrix.binary_name }} dist/${{ matrix.artifact_name }} | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binary-${{ matrix.artifact_name }} | |
| path: dist/${{ matrix.artifact_name }} | |
| build_appimage: | |
| name: Build AppImage | |
| needs: pypi_publish | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y fuse libfuse2 | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| pip install -e . | |
| - name: Download AppImage tools | |
| run: | | |
| wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage | |
| chmod +x appimagetool-x86_64.AppImage | |
| - name: Ensure data directories exist | |
| run: | | |
| mkdir -p weeb_cli/locales | |
| mkdir -p weeb_cli/templates | |
| - name: Build with PyInstaller | |
| run: | | |
| pyinstaller --name weeb-cli --onefile --clean --noconfirm \ | |
| --add-data "weeb_cli/locales:weeb_cli/locales" \ | |
| --add-data "weeb_cli/templates:weeb_cli/templates" \ | |
| --hidden-import weeb_cli.commands.api \ | |
| --hidden-import weeb_cli.commands.downloads \ | |
| --hidden-import weeb_cli.commands.library \ | |
| --hidden-import weeb_cli.commands.search \ | |
| --hidden-import weeb_cli.commands.serve \ | |
| --hidden-import weeb_cli.commands.settings \ | |
| --hidden-import weeb_cli.commands.setup \ | |
| --hidden-import weeb_cli.commands.watchlist \ | |
| --hidden-import weeb_cli.providers.tr.animecix \ | |
| --hidden-import weeb_cli.providers.tr.turkanime \ | |
| --hidden-import weeb_cli.providers.tr.anizle \ | |
| --hidden-import weeb_cli.providers.tr.weeb \ | |
| --hidden-import weeb_cli.providers.en.hianime \ | |
| --hidden-import weeb_cli.providers.en.allanime \ | |
| --hidden-import weeb_cli.providers.de.aniworld \ | |
| --copy-metadata typer \ | |
| --copy-metadata rich \ | |
| --copy-metadata questionary \ | |
| weeb_cli/__main__.py | |
| - name: Create AppDir structure | |
| run: | | |
| mkdir -p AppDir/usr/bin | |
| mkdir -p AppDir/usr/share/applications | |
| mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps | |
| cp dist/weeb-cli AppDir/usr/bin/ | |
| cat > AppDir/usr/share/applications/weeb-cli.desktop << 'EOF' | |
| [Desktop Entry] | |
| Name=Weeb CLI | |
| Exec=weeb-cli | |
| Icon=weeb-cli | |
| Type=Application | |
| Categories=Utility; | |
| Terminal=true | |
| EOF | |
| cat > AppDir/AppRun << 'EOF' | |
| #!/bin/bash | |
| SELF=$(readlink -f "$0") | |
| HERE=${SELF%/*} | |
| export PATH="${HERE}/usr/bin:${PATH}" | |
| exec "${HERE}/usr/bin/weeb-cli" "$@" | |
| EOF | |
| chmod +x AppDir/AppRun | |
| - name: Build AppImage | |
| run: | | |
| ARCH=x86_64 ./appimagetool-x86_64.AppImage AppDir weeb-cli-x86_64.AppImage | |
| chmod +x weeb-cli-x86_64.AppImage | |
| - name: Upload AppImage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binary-weeb-cli-x86_64.AppImage | |
| path: weeb-cli-x86_64.AppImage | |
| build_snap: | |
| name: Build Snap Package | |
| needs: pypi_publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create snapcraft.yaml | |
| run: | | |
| mkdir -p snap | |
| cat > snap/snapcraft.yaml << 'EOF' | |
| name: weeb-cli | |
| base: core22 | |
| version: 'VERSION_PLACEHOLDER' | |
| summary: Terminal-based anime streaming and downloading | |
| description: | | |
| Weeb CLI is a powerful terminal application for streaming and downloading anime. | |
| Features include multi-source support, download management, and tracker integration. | |
| grade: stable | |
| confinement: strict | |
| apps: | |
| weeb-cli: | |
| command: bin/weeb-cli | |
| plugs: | |
| - home | |
| - network | |
| - network-bind | |
| parts: | |
| weeb-cli: | |
| plugin: python | |
| source: . | |
| python-packages: | |
| - . | |
| stage-packages: | |
| - libffi8 | |
| EOF | |
| sed -i "s/VERSION_PLACEHOLDER/${GITHUB_REF_NAME#v}/g" snap/snapcraft.yaml | |
| - name: Build Snap | |
| uses: snapcore/action-build@v1 | |
| id: build | |
| - name: Upload Snap | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: snap-weeb-cli | |
| path: ${{ steps.build.outputs.snap }} | |
| build_flatpak: | |
| name: Build Flatpak | |
| needs: pypi_publish | |
| runs-on: ubuntu-latest | |
| container: | |
| image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08 | |
| options: --privileged | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create Flatpak manifest | |
| run: | | |
| cat > io.github.ewgsta.weeb-cli.yml << 'EOF' | |
| app-id: io.github.ewgsta.weeb-cli | |
| runtime: org.freedesktop.Platform | |
| runtime-version: '23.08' | |
| sdk: org.freedesktop.Sdk | |
| command: weeb-cli | |
| finish-args: | |
| - --share=network | |
| - --share=ipc | |
| - --socket=x11 | |
| - --socket=wayland | |
| - --filesystem=home | |
| modules: | |
| - name: weeb-cli | |
| buildsystem: simple | |
| build-commands: | |
| - pip3 install --prefix=/app --no-deps . | |
| sources: | |
| - type: dir | |
| path: . | |
| EOF | |
| - name: Build Flatpak | |
| uses: flatpak/flatpak-github-actions/flatpak-builder@v6 | |
| with: | |
| bundle: weeb-cli.flatpak | |
| manifest-path: io.github.ewgsta.weeb-cli.yml | |
| - name: Upload Flatpak | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: flatpak-weeb-cli | |
| path: weeb-cli.flatpak | |
| update_manifests: | |
| name: Update Package Manifests | |
| needs: build_binaries | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'ewgsta/weeb-cli' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create distribution manifests | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| mkdir -p distribution/homebrew | |
| cat > distribution/homebrew/weeb-cli.rb << 'FORMULA' | |
| class WeebCli < Formula | |
| desc "Terminal-based anime streaming and downloading" | |
| homepage "https://github.com/ewgsta/weeb-cli" | |
| url "https://files.pythonhosted.org/packages/source/w/weeb-cli/weeb-cli-VERSION.tar.gz" | |
| sha256 "SHA256_PLACEHOLDER" | |
| license "GPL-3.0" | |
| depends_on "python@3.12" | |
| def install | |
| virtualenv_install_with_resources | |
| end | |
| test do | |
| system bin/"weeb-cli", "--version" | |
| end | |
| end | |
| FORMULA | |
| sed -i "s/VERSION/${VERSION}/g" distribution/homebrew/weeb-cli.rb | |
| mkdir -p distribution/scoop | |
| cat > distribution/scoop/weeb-cli.json << 'SCOOP' | |
| { | |
| "version": "VERSION", | |
| "description": "Terminal-based anime streaming and downloading", | |
| "homepage": "https://github.com/ewgsta/weeb-cli", | |
| "license": "GPL-3.0", | |
| "url": "https://github.com/ewgsta/weeb-cli/releases/download/vVERSION/weeb-cli-Windows-x86_64.exe", | |
| "hash": "HASH_PLACEHOLDER", | |
| "bin": "weeb-cli-Windows-x86_64.exe", | |
| "checkver": { | |
| "github": "https://github.com/ewgsta/weeb-cli" | |
| } | |
| } | |
| SCOOP | |
| sed -i "s/VERSION/${VERSION}/g" distribution/scoop/weeb-cli.json | |
| - name: Commit manifests | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add distribution/ | |
| git diff --staged --quiet || git commit -m "chore: update package manifests for ${GITHUB_REF_NAME}" | |
| git push || echo "No changes to push" | |
| aur_publish: | |
| name: Publish to AUR | |
| needs: pypi_publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update PKGBUILD version | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| sed -i "s/^pkgver=.*/pkgver=$VERSION/" distribution/aur/PKGBUILD | |
| - name: Publish to AUR | |
| uses: KSXGitHub/github-actions-deploy-aur@v2.7.2 | |
| with: | |
| pkgname: weeb-cli | |
| pkgbuild: ./distribution/aur/PKGBUILD | |
| commit_username: ${{ secrets.AUR_USERNAME }} | |
| commit_email: ${{ secrets.AUR_EMAIL }} | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: Update to ${{ github.ref_name }} | |
| force_push: true | |
| release: | |
| name: Create GitHub Release | |
| needs: [build_binaries, build_appimage, build_snap, build_flatpak] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: binary-* | |
| merge-multiple: true | |
| - name: Download Snap | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: snap-weeb-cli | |
| path: artifacts | |
| - name: Download Flatpak | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: flatpak-weeb-cli | |
| path: artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true |