镜像自地址
https://github.com/THZoria/NX_Firmware.git
已同步 2026-04-09 10:41:13 +00:00
比较提交
16 次代码提交
21.2.0
...
f3d145640b
| 作者 | SHA1 | 提交日期 | |
|---|---|---|---|
|
|
f3d145640b | ||
|
|
acb5f7b500 | ||
|
|
c368de2568 | ||
|
|
5dfb4b0301 | ||
|
|
e53232cb55 | ||
|
|
35141cd068 | ||
|
|
99860219d6 | ||
|
|
484397aaa8 | ||
|
|
f145465763 | ||
|
|
0f244f1ced | ||
|
|
4fea53b06b | ||
|
|
c9de5c55c5 | ||
|
|
818be8376e | ||
|
|
f5d2b4e265 | ||
|
|
cfcf5e0da6 | ||
|
|
ef691f15ff |
97
.github/workflows/firmware-autodl.yml
vendored
97
.github/workflows/firmware-autodl.yml
vendored
@@ -17,11 +17,11 @@ 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'
|
||||||
|
|
||||||
- name: ⚙️ Install required Python modules
|
- name: ⚙️ Install required Python modules
|
||||||
run: |
|
run: |
|
||||||
pip install requests anynet beautifulsoup4
|
pip install requests anynet beautifulsoup4
|
||||||
@@ -30,50 +30,90 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cp hactool-linux hactool
|
cp hactool-linux hactool
|
||||||
chmod +x hactool
|
chmod +x hactool
|
||||||
|
|
||||||
- name: 🔍 Check firmware version (Switch 1 only)
|
- name: 🔍 Check firmware version (Switch 1 only, >=21.0.0 strict)
|
||||||
id: version_check
|
id: version_check
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
LATEST_TITLE=$(curl -s 'https://yls8.mtheall.com/ninupdates/feed.php' | \
|
set +e
|
||||||
grep '<title>Switch ' | \
|
|
||||||
grep -v '<title>Switch 2 ' | \
|
|
||||||
head -n 1)
|
|
||||||
|
|
||||||
if [ -z "$LATEST_TITLE" ]; then
|
RSS=$(curl -sL --fail https://yls8.mtheall.com/ninupdates/feed.php)
|
||||||
echo "::error::Could not retrieve the firmware title for Switch 1 from the RSS feed."
|
CURL_STATUS=$?
|
||||||
exit 1
|
|
||||||
|
if [ $CURL_STATUS -ne 0 ] || [ -z "$RSS" ]; then
|
||||||
|
echo "INFO: Impossible de récupérer le RSS."
|
||||||
|
echo "new_version=false" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LATEST_VERSION=$(echo "$LATEST_TITLE" | grep -oP 'Switch \K[0-9.]+')
|
# Extraire description Switch (ignore Switch 2)
|
||||||
|
DESCRIPTION=$(echo "$RSS" | grep -oE '<description>Switch [0-9]+\.[0-9]+\.[0-9]+' | \
|
||||||
|
grep -v 'Switch 2' | \
|
||||||
|
head -n 1)
|
||||||
|
|
||||||
if [ -z "$LATEST_VERSION" ]; then
|
if [ -z "$DESCRIPTION" ]; then
|
||||||
echo "::error::Failed to parse LATEST_VERSION from title: $LATEST_TITLE"
|
echo "INFO: Aucun firmware Switch valide trouvé."
|
||||||
exit 1
|
echo "new_version=false" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAG_EXISTS=$(git ls-remote --tags origin $LATEST_VERSION)
|
echo "Description détectée : $DESCRIPTION"
|
||||||
|
|
||||||
if [ ! -z "$TAG_EXISTS" ]; then
|
VERSION=$(echo "$DESCRIPTION" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
|
||||||
echo "INFO: Tag $LATEST_VERSION already exists on GitHub. Stopping workflow to avoid re-upload."
|
|
||||||
|
if [ -z "$VERSION" ]; then
|
||||||
|
echo "INFO: Impossible d'extraire la version."
|
||||||
|
echo "new_version=false" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
||||||
|
|
||||||
|
# Autorise uniquement 21+
|
||||||
|
if [ "$MAJOR" -lt 21 ]; then
|
||||||
|
echo "INFO: Firmware $VERSION ignoré (<21.x)."
|
||||||
|
echo "new_version=false" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Version valide détectée : $VERSION"
|
||||||
|
|
||||||
|
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/$VERSION")
|
||||||
|
|
||||||
|
if [ "$HTTP_STATUS" = "200" ]; then
|
||||||
|
echo "INFO: La release $VERSION existe déjà."
|
||||||
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 "INFO: Nouvelle version $VERSION détectée !"
|
||||||
echo "new_version=true" >> $GITHUB_OUTPUT
|
echo "new_version=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "firmware_version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
shell: bash
|
|
||||||
|
set -e
|
||||||
|
|
||||||
- name: 💻 Execute download script and capture changelog
|
- name: 💻 Execute download script and capture changelog
|
||||||
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 | tee firmware_output.txt
|
||||||
|
|
||||||
FIRMWARE_VERSION=$(grep 'Folder: Firmware ' firmware_output.txt | awk '{print $NF}')
|
FIRMWARE_VERSION=$(grep 'Folder: Firmware ' firmware_output.txt | awk '{print $NF}')
|
||||||
|
|
||||||
echo "firmware_version=$FIRMWARE_VERSION" >> $GITHUB_OUTPUT
|
echo "firmware_version=$FIRMWARE_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
tail -n 4 firmware_output.txt > changelog_body.txt
|
tail -n 4 firmware_output.txt > changelog_body.txt
|
||||||
|
|
||||||
|
- name: 🧹 Clean and zip firmware
|
||||||
|
if: steps.version_check.outputs.new_version == 'true'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.download.outputs.firmware_version }}"
|
||||||
|
|
||||||
|
find . -type f -name "*.nca.*" -delete
|
||||||
|
|
||||||
|
if [ -d "Firmware $VERSION" ]; then
|
||||||
|
rm -f "Firmware $VERSION.zip"
|
||||||
|
zip -rj "Firmware $VERSION.zip" "Firmware $VERSION/" -i "*.nca"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: 📝 Prepare Release Body
|
- name: 📝 Prepare Release Body
|
||||||
id: prepare_body
|
id: prepare_body
|
||||||
if: steps.version_check.outputs.new_version == 'true'
|
if: steps.version_check.outputs.new_version == 'true'
|
||||||
@@ -81,8 +121,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const changelogBody = fs.readFileSync('changelog_body.txt', 'utf8');
|
if (fs.existsSync('changelog_body.txt')) {
|
||||||
core.setOutput('release_body', changelogBody);
|
const changelogBody = fs.readFileSync('changelog_body.txt', 'utf8');
|
||||||
|
core.setOutput('release_body', changelogBody);
|
||||||
|
} else {
|
||||||
|
core.setOutput('release_body', 'No changelog available.');
|
||||||
|
}
|
||||||
|
|
||||||
- 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'
|
||||||
@@ -98,7 +142,6 @@ jobs:
|
|||||||
**Downloaded file details:**
|
**Downloaded file details:**
|
||||||
|
|
||||||
${{ steps.prepare_body.outputs.release_body }}
|
${{ steps.prepare_body.outputs.release_body }}
|
||||||
|
|
||||||
files: |
|
files: |
|
||||||
Firmware ${{ steps.download.outputs.firmware_version }}.zip
|
Firmware ${{ steps.download.outputs.firmware_version }}.zip
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ Firmware database for a discord bot
|
|||||||
|
|
||||||
<img width="618" height="670" alt="image" src="https://github.com/user-attachments/assets/279d9c21-0712-4ea8-927b-c6bb9789bb1b" />
|
<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
|
||||||
|
|
||||||
- Create a folder at the root of your microSD card and name it whatever you want.
|
- Create a folder at the root of your microSD card and name it whatever you want.
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户