Compare commits
11 Commits
6554c4248c
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ea2894664 | ||
|
|
e329275956 | ||
|
|
1f7af5fe30 | ||
|
|
bf54d2699e | ||
|
|
46d61b5562 | ||
|
|
103d353422 | ||
|
|
b8f8c60c22 | ||
|
|
03a07a9075 | ||
|
|
861ad445fc | ||
|
|
1aeb33fbf4 | ||
|
|
dd025bd185 |
@@ -14,29 +14,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Rust
|
||||||
uses: actions/setup-node@v4
|
run: |
|
||||||
with:
|
rustup toolchain install nightly --profile minimal
|
||||||
node-version: '20'
|
rustup target add wasm32-unknown-unknown --toolchain nightly
|
||||||
|
rustup component add rust-src --toolchain nightly
|
||||||
- name: Install Rust
|
rustc +nightly --version
|
||||||
uses: dtolnay/rust-toolchain@nightly
|
|
||||||
with:
|
|
||||||
targets: wasm32-unknown-unknown
|
|
||||||
components: rust-src
|
|
||||||
|
|
||||||
- name: Rust Cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: ${{ runner.os }}-cargo-mips-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-cargo-mips-
|
|
||||||
|
|
||||||
- name: Install Trunk
|
- name: Install Trunk
|
||||||
run: |
|
run: |
|
||||||
@@ -50,19 +33,30 @@ jobs:
|
|||||||
npm install
|
npm install
|
||||||
trunk build --release
|
trunk build --release
|
||||||
|
|
||||||
- name: Install Cross
|
- name: Build MIPS Builder Image
|
||||||
run: |
|
run: |
|
||||||
if ! command -v cross &> /dev/null; then
|
if ! docker image inspect vibetorrent-mips-builder >/dev/null 2>&1; then
|
||||||
cargo install cross --locked
|
docker build --platform linux/amd64 -t vibetorrent-mips-builder -f - . <<'DOCKERFILE'
|
||||||
|
FROM ghcr.io/cross-rs/mips-unknown-linux-musl:main
|
||||||
|
RUN apt-get update -qq && \
|
||||||
|
apt-get install -y -qq curl ca-certificates && \
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly --component rust-src && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
DOCKERFILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build Backend (MIPS)
|
- name: Build Backend (MIPS)
|
||||||
env:
|
|
||||||
RUSTUP_TOOLCHAIN: nightly
|
|
||||||
CROSS_NO_WARNINGS: 0
|
|
||||||
run: |
|
run: |
|
||||||
cd backend
|
docker run --rm \
|
||||||
cross build --target mips-unknown-linux-musl --release -Z build-std=std,panic_abort
|
-v "$PWD":/project \
|
||||||
|
-v cargo-mips-registry:/root/.cargo/registry \
|
||||||
|
-w /project/backend \
|
||||||
|
vibetorrent-mips-builder \
|
||||||
|
bash -c '
|
||||||
|
cargo build --target mips-unknown-linux-musl --release -Z build-std=std,panic_abort &&
|
||||||
|
file /project/target/mips-unknown-linux-musl/release/backend
|
||||||
|
'
|
||||||
|
|
||||||
- name: Rename Binary
|
- name: Rename Binary
|
||||||
run: mv target/mips-unknown-linux-musl/release/backend target/mips-unknown-linux-musl/release/vibetorrent-mips
|
run: mv target/mips-unknown-linux-musl/release/backend target/mips-unknown-linux-musl/release/vibetorrent-mips
|
||||||
@@ -73,7 +67,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ steps.tag.outputs.release_tag }}"
|
TAG="${{ steps.tag.outputs.release_tag }}"
|
||||||
REPO="admin/vibetorrent"
|
REPO="admin/vibetorrent"
|
||||||
@@ -81,7 +75,7 @@ jobs:
|
|||||||
|
|
||||||
# Create release
|
# Create release
|
||||||
RELEASE_RESPONSE=$(curl -s -X POST "${API_URL}/repos/${REPO}/releases" \
|
RELEASE_RESPONSE=$(curl -s -X POST "${API_URL}/repos/${REPO}/releases" \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${RELEASE_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{
|
-d "{
|
||||||
\"tag_name\": \"${TAG}\",
|
\"tag_name\": \"${TAG}\",
|
||||||
@@ -102,7 +96,7 @@ jobs:
|
|||||||
|
|
||||||
# Upload binary as release asset
|
# Upload binary as release asset
|
||||||
curl -s -X POST "${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=vibetorrent-mips" \
|
curl -s -X POST "${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=vibetorrent-mips" \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${RELEASE_TOKEN}" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
--data-binary @target/mips-unknown-linux-musl/release/vibetorrent-mips
|
--data-binary @target/mips-unknown-linux-musl/release/vibetorrent-mips
|
||||||
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ result.xml
|
|||||||
**/node_modules
|
**/node_modules
|
||||||
frontend/dist
|
frontend/dist
|
||||||
backend.log
|
backend.log
|
||||||
|
.runner
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ pub fn provide_torrent_store() {
|
|||||||
let max_backoff_ms: u32 = 30000; // Max 30 seconds
|
let max_backoff_ms: u32 = 30000; // Max 30 seconds
|
||||||
let mut was_connected = false;
|
let mut was_connected = false;
|
||||||
let mut disconnect_notified = false; // Track if we already showed disconnect toast
|
let mut disconnect_notified = false; // Track if we already showed disconnect toast
|
||||||
let mut got_first_message = false; // Only count as "connected" after receiving data
|
let mut got_first_message; // Only count as "connected" after receiving data
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let es_result = EventSource::new("/api/events");
|
let es_result = EventSource::new("/api/events");
|
||||||
|
|||||||
Reference in New Issue
Block a user