0
0
镜像自地址 https://github.com/THZoria/NX_Firmware.git 已同步 2026-04-09 10:41:13 +00:00

比较提交

..

21 次代码提交

作者 SHA1 备注 提交日期
Zoria
df02467cdd Improve firmware download workflow and messages
Refactor firmware download workflow for clarity and accuracy.
2026-03-17 07:06:25 +01:00
Zoria
a3b5ff8eea Refactor firmware autodl workflow for improved checks 2026-03-17 07:04:25 +01:00
Zoria
bf849d454d Add lxml to Python module installation 2026-03-17 07:01:41 +01:00
Zoria
e5cac716b8 Refactor firmware autodl workflow for better handling
Updated the firmware autodl workflow to improve Python script and file handling.
2026-03-17 07:00:35 +01:00
Zoria
9f2d533eb2 Refactor firmware extraction and version handling 2026-03-17 06:52:05 +01:00
Zoria
f3d145640b Fix firmware version check and update logic 2026-02-22 00:28:25 +01:00
Zoria
acb5f7b500 Update firmware autodl workflow for version checks 2026-02-22 00:26:09 +01:00
Zoria
c368de2568 Refactor firmware version check and download script 2026-02-22 00:23:44 +01:00
Zoria
5dfb4b0301 Enhance firmware auto downloader workflow
Updated the firmware auto downloader workflow to improve release notes preparation and streamline version checking.
2026-02-22 00:22:38 +01:00
Zoria
e53232cb55 Update firmware auto downloader workflow to v21.0.0
Updated the firmware auto downloader workflow to include version 21.0.0, added new dependencies, and improved error handling.
2026-02-22 00:21:57 +01:00
Zoria
35141cd068 Enhance firmware version check for Switch 1
Updated the firmware version check to include version 21.0.0 and modified output messages for clarity.
2026-01-24 21:25:42 +01:00
Zoria
99860219d6 Enhance firmware autodl workflow with changelog check
Added check for changelog existence before reading.
2026-01-24 21:21:43 +01:00
Zoria
484397aaa8 Fix firmware version check and tag existence logic 2026-01-24 21:18:38 +01:00
Zoria
f145465763 Update version check logic in firmware-autodl.yml 2026-01-24 21:16:41 +01:00
Zoria
0f244f1ced Refactor firmware version check in workflow 2026-01-24 21:15:06 +01:00
Zoria
4fea53b06b Fix zip command and version check in workflow 2026-01-24 21:10:25 +01:00
Zoria
c9de5c55c5 Refactor firmware autodl workflow for clarity and efficiency
Updated the workflow to install Python dependencies separately and improved the logic for checking firmware versions and creating releases.
2026-01-24 21:05:26 +01:00
Zoria
818be8376e Refactor firmware workflow for version handling 2026-01-24 21:00:59 +01:00
Zoria
f5d2b4e265 Refactor firmware download workflow steps 2026-01-24 20:56:51 +01:00
Zoria
cfcf5e0da6 Enhance README with badges for Discord and version
Added Discord and version badges to README.
2026-01-15 19:30:17 +01:00
Zoria
ef691f15ff Create firmware zip while excluding variant files
Add step to create firmware zip excluding .nca.1 files
2026-01-13 08:22:10 +01:00
修改 2 个文件,包含 86 行新增39 行删除

查看文件

@@ -17,50 +17,79 @@ 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
- name: ⬇️ Setup hactool-linux - name: ⬇️ Setup hactool-linux
run: | run: |
cp hactool-linux hactool if [ -f "hactool-linux" ]; then
chmod +x hactool cp hactool-linux hactool
chmod +x hactool
- name: 🔍 Check firmware version (Switch 1 only) else
id: version_check echo "Warning: hactool-linux non trouvé."
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 strict)
id: version_check
shell: bash
run: |
set +e
# Récupération du flux RSS
RSS=$(curl -sL --fail https://yls8.mtheall.com/ninupdates/feed.php)
if [ $? -ne 0 ] || [ -z "$RSS" ]; then
echo "ERROR: Impossible de récupérer le flux RSS."
echo "new_version=false" >> $GITHUB_OUTPUT
exit 0
fi
# LOGIQUE DE DÉTECTION ROBUSTE :
# 1. On extrait les blocs <item> pour ne pas mélanger les données
# 2. On filtre uniquement ceux qui contiennent 'sys=hac' (Switch 1)
# 3. On extrait le numéro de version X.X.X
# 4. On trie par version (sort -V) et on prend la plus haute
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 "INFO: Aucun firmware Switch 1 trouvé."
exit 1 echo "new_version=false" >> $GITHUB_OUTPUT
exit 0
fi fi
TAG_EXISTS=$(git ls-remote --tags origin $LATEST_VERSION) echo "Dernière version Switch 1 détectée : $LATEST_VERSION"
if [ ! -z "$TAG_EXISTS" ]; then # Vérification du seuil (>= 21)
echo "INFO: Tag $LATEST_VERSION already exists on GitHub. Stopping workflow to avoid re-upload." MAJOR=$(echo "$LATEST_VERSION" | cut -d. -f1)
if [ "$MAJOR" -lt 21 ]; then
echo "INFO: Version $LATEST_VERSION ignorée (seuil < 21)."
echo "new_version=false" >> $GITHUB_OUTPUT
exit 0
fi
# Vérification si la release existe déjà
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 "INFO: La release $LATEST_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 "ACTION: Nouvelle version $LATEST_VERSION détectée !"
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 and capture changelog
id: download id: download
@@ -68,12 +97,30 @@ jobs:
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}') # Extraction de la version confirmée par le script (nettoyage des retours chariot)
F_VER=$(grep 'Folder: Firmware ' firmware_output.txt | awk '{print $NF}' | tr -d '\r')
echo "firmware_version=$FIRMWARE_VERSION" >> $GITHUB_OUTPUT if [ -z "$F_VER" ]; then
F_VER="${{ steps.version_check.outputs.firmware_version }}"
fi
echo "firmware_version=$F_VER" >> $GITHUB_OUTPUT
tail -n 10 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"
else
echo "ERROR: Dossier Firmware $VERSION introuvable."
exit 1
fi
tail -n 4 firmware_output.txt > changelog_body.txt
- 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 +128,12 @@ jobs:
with: with:
script: | script: |
const fs = require('fs'); const fs = require('fs');
const changelogBody = fs.readFileSync('changelog_body.txt', 'utf8'); let body = "Automatic download of official Nintendo Switch firmware.";
core.setOutput('release_body', changelogBody); if (fs.existsSync('changelog_body.txt')) {
const changelog = fs.readFileSync('changelog_body.txt', 'utf8');
body += "\n\n**Changelog / Output:**\n```\n" + changelog + "\n```";
}
core.setOutput('release_body', body);
- 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'
@@ -90,15 +141,7 @@ jobs:
with: with:
tag_name: ${{ steps.download.outputs.firmware_version }} tag_name: ${{ steps.download.outputs.firmware_version }}
name: Firmware ${{ steps.download.outputs.firmware_version }} name: Firmware ${{ steps.download.outputs.firmware_version }}
body: | body: ${{ steps.prepare_body.outputs.release_body }}
Automatic download of the official Nintendo Switch firmware version **${{ steps.download.outputs.firmware_version }}**.
---
**Downloaded file details:**
${{ 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" />
[![Discord](https://img.shields.io/discord/454099185416011776?label=Rejoindre%20le%20Discord&logo=discord&logoColor=white&style=for-the-badge)](https://discord.sighya.fr) <br>
[![Dernière version](https://img.shields.io/github/v/release/THZoria/NX_Firmware?label=Dernière%20Version&color=05c09a&style=for-the-badge)](https://github.com/THZoria/NX_Firmware/releases/latest)
[![Téléchargements](https://img.shields.io/github/downloads/THZoria/NX_Firmware/total?label=Téléchargements&color=blue&style=for-the-badge)](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.