镜像自地址
https://github.com/THZoria/NX_Firmware.git
已同步 2026-04-09 10:41:13 +00:00
比较提交
23 次代码提交
| 作者 | SHA1 | 提交日期 | |
|---|---|---|---|
|
|
cd09390cd5 | ||
|
|
df02467cdd | ||
|
|
a3b5ff8eea | ||
|
|
bf849d454d | ||
|
|
e5cac716b8 | ||
|
|
9f2d533eb2 | ||
|
|
f3d145640b | ||
|
|
acb5f7b500 | ||
|
|
c368de2568 | ||
|
|
5dfb4b0301 | ||
|
|
e53232cb55 | ||
|
|
35141cd068 | ||
|
|
99860219d6 | ||
|
|
484397aaa8 | ||
|
|
f145465763 | ||
|
|
0f244f1ced | ||
|
|
4fea53b06b | ||
|
|
c9de5c55c5 | ||
|
|
818be8376e | ||
|
|
f5d2b4e265 | ||
|
|
cfcf5e0da6 | ||
|
|
ef691f15ff | ||
|
|
af4454aaf2 |
110
.github/workflows/firmware-autodl.yml
vendored
110
.github/workflows/firmware-autodl.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: 🐍 Setup Python and dependencies
|
- name: 🐍 Setup Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
@@ -28,61 +28,89 @@ jobs:
|
|||||||
|
|
||||||
- name: ⬇️ Setup hactool-linux
|
- name: ⬇️ Setup hactool-linux
|
||||||
run: |
|
run: |
|
||||||
|
if [ -f "hactool-linux" ]; then
|
||||||
cp hactool-linux hactool
|
cp hactool-linux hactool
|
||||||
chmod +x hactool
|
chmod +x hactool
|
||||||
|
else
|
||||||
- name: 🔍 Check firmware version (Switch 1 only)
|
echo "Warning: hactool-linux non trouvé."
|
||||||
id: version_check
|
|
||||||
run: |
|
|
||||||
LATEST_TITLE=$(curl -s 'https://yls8.mtheall.com/ninupdates/feed.php' | \
|
|
||||||
grep '<title>Switch ' | \
|
|
||||||
grep -v '<title>Switch 2 ' | \
|
|
||||||
head -n 1)
|
|
||||||
|
|
||||||
if [ -z "$LATEST_TITLE" ]; then
|
|
||||||
echo "::error::Could not retrieve the firmware title for Switch 1 from the RSS feed."
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LATEST_VERSION=$(echo "$LATEST_TITLE" | grep -oP 'Switch \K[0-9.]+')
|
- name: 🔍 Check firmware version (Switch 1 only, >=21.0.0)
|
||||||
|
id: version_check
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
RSS=$(curl -sL --fail https://yls8.mtheall.com/ninupdates/feed.php)
|
||||||
|
if [ $? -ne 0 ] || [ -z "$RSS" ]; then
|
||||||
|
echo "new_version=false" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Extraction stricte Switch 1 (hac) + Tri version
|
||||||
|
LATEST_VERSION=$(echo "$RSS" | tr -d '\n' | sed 's/<item>/\n<item>/g' | \
|
||||||
|
grep 'sys=hac' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
|
||||||
|
|
||||||
if [ -z "$LATEST_VERSION" ]; then
|
if [ -z "$LATEST_VERSION" ]; then
|
||||||
echo "::error::Failed to parse LATEST_VERSION from title: $LATEST_TITLE"
|
echo "new_version=false" >> $GITHUB_OUTPUT
|
||||||
exit 1
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAG_EXISTS=$(git ls-remote --tags origin $LATEST_VERSION)
|
MAJOR=$(echo "$LATEST_VERSION" | cut -d. -f1)
|
||||||
|
if [ "$MAJOR" -lt 21 ]; then
|
||||||
|
echo "new_version=false" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -z "$TAG_EXISTS" ]; then
|
# Check si la Release existe
|
||||||
echo "INFO: Tag $LATEST_VERSION already exists on GitHub. Stopping workflow to avoid re-upload."
|
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||||
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
|
"https://api.github.com/repos/${{ github.repository }}/releases/tags/$LATEST_VERSION")
|
||||||
|
|
||||||
|
if [ "$HTTP_STATUS" = "200" ]; then
|
||||||
echo "new_version=false" >> $GITHUB_OUTPUT
|
echo "new_version=false" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "INFO: New version $LATEST_VERSION found! Preparing to download..."
|
|
||||||
echo "new_version=true" >> $GITHUB_OUTPUT
|
echo "new_version=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "firmware_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
shell: bash
|
set -e
|
||||||
|
|
||||||
- name: 💻 Execute download script and capture changelog
|
- name: 💻 Execute download script
|
||||||
id: download
|
id: download
|
||||||
if: steps.version_check.outputs.new_version == 'true'
|
if: steps.version_check.outputs.new_version == 'true'
|
||||||
run: |
|
run: |
|
||||||
python3 firmware_downloader.py | tee firmware_output.txt
|
python3 firmware_downloader.py
|
||||||
|
VERSION="${{ steps.version_check.outputs.firmware_version }}"
|
||||||
|
echo "firmware_version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
FIRMWARE_VERSION=$(grep 'Folder: Firmware ' firmware_output.txt | awk '{print $NF}')
|
- name: 🧹 Clean and Generate Changelog
|
||||||
|
id: cleanup
|
||||||
echo "firmware_version=$FIRMWARE_VERSION" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
tail -n 4 firmware_output.txt > changelog_body.txt
|
|
||||||
|
|
||||||
- name: 📝 Prepare Release Body
|
|
||||||
id: prepare_body
|
|
||||||
if: steps.version_check.outputs.new_version == 'true'
|
if: steps.version_check.outputs.new_version == 'true'
|
||||||
uses: actions/github-script@v7
|
run: |
|
||||||
with:
|
VERSION="${{ steps.download.outputs.firmware_version }}"
|
||||||
script: |
|
DIR="Firmware $VERSION"
|
||||||
const fs = require('fs');
|
|
||||||
const changelogBody = fs.readFileSync('changelog_body.txt', 'utf8');
|
if [ -d "$DIR" ]; then
|
||||||
core.setOutput('release_body', changelogBody);
|
# Suppression des fichiers .1.nca et fragments
|
||||||
|
find "$DIR" -type f -name "*.[0-9].nca" -delete
|
||||||
|
find "$DIR" -type f -name "*.nca.*" -delete
|
||||||
|
|
||||||
|
# Extraction des SystemVersion NCA (fichiers de ~128KB)
|
||||||
|
# On cherche les fichiers NCA et on les trie par taille pour identifier les SystemVersion
|
||||||
|
SV_FAT=$(ls -S "$DIR"/*.nca | tail -n 2 | head -n 1 | xargs basename)
|
||||||
|
SV_EXFAT=$(ls -S "$DIR"/*.nca | tail -n 1 | xargs basename)
|
||||||
|
|
||||||
|
# Création du changelog personnalisé
|
||||||
|
echo "Archive created: Firmware $VERSION.zip" > changelog_body.txt
|
||||||
|
echo "SystemVersion NCA FAT: $SV_FAT" >> changelog_body.txt
|
||||||
|
echo "SystemVersion NCA exFAT: $SV_EXFAT" >> changelog_body.txt
|
||||||
|
echo "Verify hashes before installation!" >> changelog_body.txt
|
||||||
|
|
||||||
|
# Compression
|
||||||
|
zip -rj "Firmware $VERSION.zip" "$DIR/" -i "*.nca"
|
||||||
|
else
|
||||||
|
echo "Dossier non trouvé"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: 📦 Create Tag and Release
|
- name: 📦 Create Tag and Release
|
||||||
if: steps.version_check.outputs.new_version == 'true'
|
if: steps.version_check.outputs.new_version == 'true'
|
||||||
@@ -93,12 +121,10 @@ jobs:
|
|||||||
body: |
|
body: |
|
||||||
Automatic download of the official Nintendo Switch firmware version **${{ steps.download.outputs.firmware_version }}**.
|
Automatic download of the official Nintendo Switch firmware version **${{ steps.download.outputs.firmware_version }}**.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Downloaded file details:**
|
**Downloaded file details:**
|
||||||
|
```text
|
||||||
${{ steps.prepare_body.outputs.release_body }}
|
$(cat changelog_body.txt)
|
||||||
|
```
|
||||||
files: |
|
files: |
|
||||||
Firmware ${{ steps.download.outputs.firmware_version }}.zip
|
Firmware ${{ steps.download.outputs.firmware_version }}.zip
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ Firmware for the Nintendo Switch
|
|||||||
# Utility
|
# Utility
|
||||||
Firmware database for a discord bot
|
Firmware database for a discord bot
|
||||||
|
|
||||||
<img width="787" height="819" alt="image" src="https://github.com/user-attachments/assets/e338a3f5-e54b-4ae0-be8c-524944f1855b" />
|
<img width="618" height="670" alt="image" src="https://github.com/user-attachments/assets/279d9c21-0712-4ea8-927b-c6bb9789bb1b" />
|
||||||
|
|
||||||
|
[](https://discord.sighya.fr) <br>
|
||||||
|
[](https://github.com/THZoria/NX_Firmware/releases/latest)
|
||||||
|
[](https://github.com/THZoria/NX_Firmware)
|
||||||
|
|
||||||
# How to update a modified Switch / Under custom firmware
|
# How to update a modified Switch / Under custom firmware
|
||||||
|
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户