diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56819c7..5d6e9f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,13 @@ jobs: target: ppc64le steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Build frontend + run: | + npm install + npm run build - uses: actions/setup-python@v5 with: python-version: 3.x @@ -47,14 +54,14 @@ jobs: target: ${{ matrix.platform.target }} args: --release --out dist sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - manylinux: auto + manylinux: ${{ matrix.platform.target == 'aarch64' && '2_28' || 'auto' }} - name: Build free-threaded wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} args: --release --out dist -i python3.13t sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - manylinux: auto + manylinux: ${{ matrix.platform.target == 'aarch64' && '2_28' || 'auto' }} - name: Upload wheels uses: actions/upload-artifact@v4 with: @@ -76,6 +83,13 @@ jobs: target: armv7 steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Build frontend + run: | + npm install + npm run build - uses: actions/setup-python@v5 with: python-version: 3.x @@ -110,6 +124,13 @@ jobs: target: x86 steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Build frontend + run: | + npm install + npm run build - uses: actions/setup-python@v5 with: python-version: 3.x @@ -147,6 +168,13 @@ jobs: target: aarch64 steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Build frontend + run: | + npm install + npm run build - uses: actions/setup-python@v5 with: python-version: 3.x @@ -172,6 +200,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Build frontend + run: | + npm install + npm run build - name: Build sdist uses: PyO3/maturin-action@v1 with: diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 79ecf47..60485e4 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,93 +1,93 @@ -name: Docker - -on: - push: - # Publish `master` as Docker `latest` image. - branches: - - master - - # Publish `v1.2.3` tags as releases. - tags: - - v* - - # Run tests for any PRs. - pull_request: - -jobs: - # Run tests. - # See also https://docs.docker.com/docker-hub/builds/automated-testing/ - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Get PR number, repo URL, and branch name - run: | - if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then - pr_number=$(jq -r .number < "$GITHUB_EVENT_PATH") - repo_url=$(jq -r .pull_request.head.repo.clone_url < "$GITHUB_EVENT_PATH") - branch_name=$GITHUB_HEAD_REF - else - pr_number="" - repo_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY - branch_name="master" - fi - echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV - echo "REPO_URL=$repo_url" >> $GITHUB_ENV - echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV - - - name: Run tests - run: | - if [ -f docker-compose.test.yml ]; then - docker-compose --file docker-compose.test.yml build - docker-compose --file docker-compose.test.yml run sut - else - docker build \ - --build-arg repo_url=$REPO_URL \ - --build-arg branch_name=$BRANCH_NAME \ - . --file Dockerfile - fi - - - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - push: - # Ensure test job passes before pushing image. - needs: test - - runs-on: ubuntu-latest - if: github.event_name == 'push' - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - # list of Docker images to use as base name for tags - images: | - ghcr.io/biliup/caution - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} +#name: Docker +# +#on: +# push: +# # Publish `master` as Docker `latest` image. +# branches: +# - master +# +# # Publish `v1.2.3` tags as releases. +# tags: +# - v* +# +# # Run tests for any PRs. +# pull_request: +# +#jobs: +# # Run tests. +# # See also https://docs.docker.com/docker-hub/builds/automated-testing/ +# test: +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@v2 +# +# - name: Get PR number, repo URL, and branch name +# run: | +# if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then +# pr_number=$(jq -r .number < "$GITHUB_EVENT_PATH") +# repo_url=$(jq -r .pull_request.head.repo.clone_url < "$GITHUB_EVENT_PATH") +# branch_name=$GITHUB_HEAD_REF +# else +# pr_number="" +# repo_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY +# branch_name="master" +# fi +# echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV +# echo "REPO_URL=$repo_url" >> $GITHUB_ENV +# echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV +# +# - name: Run tests +# run: | +# if [ -f docker-compose.test.yml ]; then +# docker-compose --file docker-compose.test.yml build +# docker-compose --file docker-compose.test.yml run sut +# else +# docker build \ +# --build-arg repo_url=$REPO_URL \ +# --build-arg branch_name=$BRANCH_NAME \ +# . --file Dockerfile +# fi +# +# +# # Push image to GitHub Packages. +# # See also https://docs.docker.com/docker-hub/builds/ +# push: +# # Ensure test job passes before pushing image. +# needs: test +# +# runs-on: ubuntu-latest +# if: github.event_name == 'push' +# +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - name: Docker meta +# id: meta +# uses: docker/metadata-action@v4 +# with: +# # list of Docker images to use as base name for tags +# images: | +# ghcr.io/biliup/caution +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v2 +# +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v2 +# +# - name: Login to DockerHub +# uses: docker/login-action@v2 +# with: +# registry: ghcr.io +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} +# +# - name: Build and push +# uses: docker/build-push-action@v3 +# with: +# context: . +# platforms: linux/amd64,linux/arm64 +# push: true +# tags: ${{ steps.meta.outputs.tags }} +# labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/pyinstaller-publish.yml b/.github/workflows/pyinstaller-publish.yml index 717195f..4c33abf 100644 --- a/.github/workflows/pyinstaller-publish.yml +++ b/.github/workflows/pyinstaller-publish.yml @@ -13,18 +13,21 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20 + - name: Build frontend + run: | + npm install + npm run build - uses: actions/setup-python@v5 with: python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine build pyinstaller - npm install - pip install . + - uses: PyO3/maturin-action@v1 + with: + command: develop + args: --release - name: Build run: | - npm run build + python -m pip install --upgrade pip + pip install pyinstaller pyinstaller biliup.spec # Optionally verify that it works (provided that it does not need user interaction) #- run: ./dist/your-code/your-code diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index 8adf85a..0000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Upload Python Package - -on: - release: - types: [created] -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '20' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine build - npm install - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - npm run build - python -m build - twine upload dist/* diff --git a/Cargo.lock b/Cargo.lock index 14a3eb3..c4a37ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5289,7 +5289,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stream-gears" -version = "0.4.101" +version = "0.4.102" dependencies = [ "anyhow", "biliup", diff --git a/crates/stream-gears/Cargo.toml b/crates/stream-gears/Cargo.toml index 7f751ec..9568341 100644 --- a/crates/stream-gears/Cargo.toml +++ b/crates/stream-gears/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stream-gears" -version = "0.4.101" +version = "0.4.102" edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/pyproject.toml b/pyproject.toml index c36bd87..1d1e721 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,6 @@ urls = { Homepage = "https://github.com/ForgQi/bilibiliupload" } requires-python = ">= 3.9" dependencies = [ "tomli-w>=1.0.0", - "stream-gears >= 0.2.2,<0.3", "psutil >= 5.4.6", "aiofiles >= 22.1.0", "yt-dlp >= 2025.3.31",