Compare commits
6 Commits
6554c4248c
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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: |
|
||||||
@@ -57,12 +40,21 @@ jobs:
|
|||||||
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 --platform linux/amd64 \
|
||||||
cross build --target mips-unknown-linux-musl --release -Z build-std=std,panic_abort
|
-v "$PWD":/project \
|
||||||
|
-v cargo-cache:/usr/local/cargo/registry \
|
||||||
|
-w /project \
|
||||||
|
rust:latest \
|
||||||
|
bash -c '
|
||||||
|
rustup toolchain install nightly --component rust-src &&
|
||||||
|
apt-get update -qq && apt-get install -y -qq musl-tools wget >/dev/null 2>&1 &&
|
||||||
|
wget -qO- https://musl.cc/mips-linux-musl-cross.tgz | tar xz -C /opt/ &&
|
||||||
|
export PATH="/opt/mips-linux-musl-cross/bin:$PATH" &&
|
||||||
|
export CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_LINKER=mips-linux-musl-gcc &&
|
||||||
|
cd backend &&
|
||||||
|
cargo +nightly build --target mips-unknown-linux-musl --release -Z build-std=std,panic_abort
|
||||||
|
'
|
||||||
|
|
||||||
- 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 +65,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 +73,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 +94,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
|
||||||
|
|||||||
Reference in New Issue
Block a user