Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c87501c40 | ||
|
|
68d949aa5b | ||
|
|
da6bf4fd04 | ||
|
|
f973bf3107 | ||
|
|
4f4508ccc3 | ||
|
|
84125ef688 | ||
|
|
c10249d171 | ||
|
|
576706dc17 | ||
|
|
b5d635d96f | ||
|
|
00263ec4ba | ||
|
|
6e91c0ac31 | ||
|
|
df1e68b378 | ||
|
|
e39129c300 | ||
|
|
e64386ebe5 | ||
|
|
cda44e07a8 |
@@ -32,17 +32,17 @@ jobs:
|
||||
config: [x86-ansi, x86-unicode, x64-unicode]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
|
||||
- name: Read VERSION
|
||||
id: version
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
Copy-Item $src $dst
|
||||
|
||||
- name: Upload DLL
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}-${{ steps.version.outputs.version }}-${{ matrix.config }}
|
||||
path: dist/**
|
||||
@@ -79,12 +79,12 @@ jobs:
|
||||
config: [x86-ansi, x86-unicode, x64-unicode]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
@@ -119,7 +119,7 @@ jobs:
|
||||
cp "plugins/$dir/nsis7z.dll" "$dst/"
|
||||
|
||||
- name: Upload DLL
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}-${{ steps.version_linux.outputs.version }}-${{ matrix.config }}-linux
|
||||
path: dist/**
|
||||
|
||||
+244
-15
@@ -13,27 +13,33 @@ on:
|
||||
tag:
|
||||
description: 'Tag versione (es. v1.7.0)'
|
||||
required: true
|
||||
gitea_only:
|
||||
description: 'Esegui solo sync release body su Gitea (salta build e GitHub release)'
|
||||
type: boolean
|
||||
required: false
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.gitea_only) }}
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
config: [x86-ansi, x86-unicode, x64-unicode]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- uses: microsoft/setup-msbuild@v2
|
||||
- uses: microsoft/setup-msbuild@v3
|
||||
|
||||
- name: Build ${{ matrix.config }}
|
||||
run: python build_plugin.py --config ${{ matrix.config }}
|
||||
@@ -63,23 +69,24 @@ jobs:
|
||||
if (Test-Path "examples") { Copy-Item "examples" $stage -Recurse }
|
||||
Compress-Archive -Path "$stage/*" -DestinationPath "$name.zip" -Force
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: pkg-${{ matrix.config }}
|
||||
path: '*.zip'
|
||||
|
||||
build-linux:
|
||||
if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.gitea_only) }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
config: [x86-ansi, x86-unicode, x64-unicode]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
@@ -107,23 +114,41 @@ jobs:
|
||||
mkdir -p "$dst"
|
||||
cp "plugins/$dir/nsis7z.dll" "$dst/"
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: linux-build-${{ matrix.config }}
|
||||
path: dist/**
|
||||
if-no-files-found: error
|
||||
|
||||
publish:
|
||||
if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.gitea_only) }}
|
||||
needs: [build, build-linux]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: artifacts
|
||||
merge-multiple: true
|
||||
|
||||
- name: Extract changelog section
|
||||
run: |
|
||||
tag="${{ github.ref_name }}"
|
||||
if [ -z "$tag" ] || [ "$tag" = "main" ]; then
|
||||
tag="${{ inputs.tag }}"
|
||||
fi
|
||||
version="${tag#v}"
|
||||
awk -v ver="[$version]" '
|
||||
/^## / && index($0, ver) { found=1; next }
|
||||
found && /^## / { exit }
|
||||
found { print }
|
||||
' CHANGELOG.md > release_body.md
|
||||
# Append Gitea notice
|
||||
echo "" >> release_body.md
|
||||
echo "---" >> release_body.md
|
||||
echo "_Repository primario: vedi link Gitea nel README. Il mirror GitHub è generato automaticamente._" >> release_body.md
|
||||
|
||||
- name: SHA256SUMS
|
||||
run: |
|
||||
cd artifacts
|
||||
@@ -131,14 +156,218 @@ jobs:
|
||||
cat SHA256SUMS.txt
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
uses: softprops/action-gh-release@v3
|
||||
with:
|
||||
files: |
|
||||
artifacts/*.zip
|
||||
artifacts/SHA256SUMS.txt
|
||||
generate_release_notes: true
|
||||
body: |
|
||||
**Repository primario**: vedi link Gitea nel README.
|
||||
body_path: release_body.md
|
||||
|
||||
Il mirror GitHub è generato automaticamente dal repo Gitea (sorgente di verità ).
|
||||
Per issue e PR aprire ticket sul repository primario Gitea.
|
||||
- name: Update Gitea Release body
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
GITEA_TAG: ${{ github.ref_name }}
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import json
|
||||
import os
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
base = "https://gitea.emulab.it/api/v1"
|
||||
repo = "Simone/nsis-plugin-ns7zip"
|
||||
tag = os.environ.get("GITEA_TAG", "").strip()
|
||||
if not tag or tag == "main":
|
||||
tag = os.environ.get("INPUT_TAG", "").strip()
|
||||
token = os.environ.get("GITEA_TOKEN", "").strip()
|
||||
|
||||
if not tag:
|
||||
raise SystemExit("Tag non disponibile: imposta input 'tag' in workflow_dispatch")
|
||||
if not token:
|
||||
raise SystemExit("GITEA_TOKEN is missing or empty")
|
||||
|
||||
with open("release_body.md", "r", encoding="utf-8") as f:
|
||||
body = f.read()
|
||||
|
||||
def request(method, path, payload=None, auth_scheme="token"):
|
||||
data = json.dumps(payload).encode("utf-8") if payload is not None else None
|
||||
req = urllib.request.Request(
|
||||
f"{base}{path}",
|
||||
data=data,
|
||||
method=method,
|
||||
headers={
|
||||
"Authorization": f"{auth_scheme} {token}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
"User-Agent": "GitHubActions-GiteaReleaseSync/1.0",
|
||||
},
|
||||
)
|
||||
with urllib.request.urlopen(req) as resp:
|
||||
return json.loads(resp.read().decode("utf-8"))
|
||||
|
||||
auth_scheme = None
|
||||
last_error = None
|
||||
for scheme in ("token", "Bearer"):
|
||||
try:
|
||||
user = request("GET", "/user", auth_scheme=scheme)
|
||||
auth_scheme = scheme
|
||||
print(f"Gitea auth OK via '{scheme}' as user: {user.get('login', '<unknown>')}")
|
||||
break
|
||||
except urllib.error.HTTPError as e:
|
||||
try:
|
||||
details = e.read().decode("utf-8", errors="replace")
|
||||
except Exception:
|
||||
details = ""
|
||||
last_error = f"HTTP {e.code} {e.reason} ({scheme}) {details}".strip()
|
||||
|
||||
if not auth_scheme:
|
||||
raise SystemExit(
|
||||
"Gitea authentication failed for both 'token' and 'Bearer'. "
|
||||
"Check secret GITEA_TOKEN value and permissions (Repository Read+Write). "
|
||||
f"Last error: {last_error}"
|
||||
)
|
||||
|
||||
try:
|
||||
release = request("GET", f"/repos/{repo}/releases/tags/{tag}", auth_scheme=auth_scheme)
|
||||
rid = release["id"]
|
||||
request("PATCH", f"/repos/{repo}/releases/{rid}", {"body": body}, auth_scheme=auth_scheme)
|
||||
print(f"Updated existing Gitea release id={rid} for tag {tag}")
|
||||
except urllib.error.HTTPError as e:
|
||||
if e.code != 404:
|
||||
try:
|
||||
details = e.read().decode("utf-8", errors="replace")
|
||||
except Exception:
|
||||
details = ""
|
||||
raise SystemExit(f"Gitea release lookup/update failed: HTTP {e.code} {e.reason}. {details}".strip())
|
||||
|
||||
created = request(
|
||||
"POST",
|
||||
f"/repos/{repo}/releases",
|
||||
{
|
||||
"tag_name": tag,
|
||||
"name": tag,
|
||||
"body": body,
|
||||
"draft": False,
|
||||
"prerelease": False,
|
||||
},
|
||||
auth_scheme=auth_scheme,
|
||||
)
|
||||
print(f"Created Gitea release id={created['id']} for tag {tag}")
|
||||
PY
|
||||
|
||||
sync-gitea-only:
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.gitea_only }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Extract changelog section
|
||||
run: |
|
||||
tag="${{ inputs.tag }}"
|
||||
version="${tag#v}"
|
||||
awk -v ver="[$version]" '
|
||||
/^## / && index($0, ver) { found=1; next }
|
||||
found && /^## / { exit }
|
||||
found { print }
|
||||
' CHANGELOG.md > release_body.md
|
||||
if [ ! -s release_body.md ]; then
|
||||
echo "Sezione CHANGELOG non trovata per $tag"
|
||||
exit 1
|
||||
fi
|
||||
echo "" >> release_body.md
|
||||
echo "---" >> release_body.md
|
||||
echo "_Repository primario: vedi link Gitea nel README. Il mirror GitHub è generato automaticamente._" >> release_body.md
|
||||
|
||||
- name: Update Gitea Release body
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
GITEA_TAG: ${{ github.ref_name }}
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import json
|
||||
import os
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
base = "https://gitea.emulab.it/api/v1"
|
||||
repo = "Simone/nsis-plugin-ns7zip"
|
||||
tag = os.environ.get("GITEA_TAG", "").strip()
|
||||
if not tag or tag == "main":
|
||||
tag = os.environ.get("INPUT_TAG", "").strip()
|
||||
token = os.environ.get("GITEA_TOKEN", "").strip()
|
||||
|
||||
if not tag:
|
||||
raise SystemExit("Tag non disponibile: imposta input 'tag' in workflow_dispatch")
|
||||
if not token:
|
||||
raise SystemExit("GITEA_TOKEN is missing or empty")
|
||||
|
||||
with open("release_body.md", "r", encoding="utf-8") as f:
|
||||
body = f.read()
|
||||
|
||||
def request(method, path, payload=None, auth_scheme="token"):
|
||||
data = json.dumps(payload).encode("utf-8") if payload is not None else None
|
||||
req = urllib.request.Request(
|
||||
f"{base}{path}",
|
||||
data=data,
|
||||
method=method,
|
||||
headers={
|
||||
"Authorization": f"{auth_scheme} {token}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
"User-Agent": "GitHubActions-GiteaReleaseSync/1.0",
|
||||
},
|
||||
)
|
||||
with urllib.request.urlopen(req) as resp:
|
||||
return json.loads(resp.read().decode("utf-8"))
|
||||
|
||||
auth_scheme = None
|
||||
last_error = None
|
||||
for scheme in ("token", "Bearer"):
|
||||
try:
|
||||
user = request("GET", "/user", auth_scheme=scheme)
|
||||
auth_scheme = scheme
|
||||
print(f"Gitea auth OK via '{scheme}' as user: {user.get('login', '<unknown>')}")
|
||||
break
|
||||
except urllib.error.HTTPError as e:
|
||||
try:
|
||||
details = e.read().decode("utf-8", errors="replace")
|
||||
except Exception:
|
||||
details = ""
|
||||
last_error = f"HTTP {e.code} {e.reason} ({scheme}) {details}".strip()
|
||||
|
||||
if not auth_scheme:
|
||||
raise SystemExit(
|
||||
"Gitea authentication failed for both 'token' and 'Bearer'. "
|
||||
"Check secret GITEA_TOKEN value and permissions (Repository Read+Write). "
|
||||
f"Last error: {last_error}"
|
||||
)
|
||||
|
||||
try:
|
||||
release = request("GET", f"/repos/{repo}/releases/tags/{tag}", auth_scheme=auth_scheme)
|
||||
rid = release["id"]
|
||||
request("PATCH", f"/repos/{repo}/releases/{rid}", {"body": body}, auth_scheme=auth_scheme)
|
||||
print(f"Updated existing Gitea release id={rid} for tag {tag}")
|
||||
except urllib.error.HTTPError as e:
|
||||
if e.code != 404:
|
||||
try:
|
||||
details = e.read().decode("utf-8", errors="replace")
|
||||
except Exception:
|
||||
details = ""
|
||||
raise SystemExit(f"Gitea release lookup/update failed: HTTP {e.code} {e.reason}. {details}".strip())
|
||||
|
||||
created = request(
|
||||
"POST",
|
||||
f"/repos/{repo}/releases",
|
||||
{
|
||||
"tag_name": tag,
|
||||
"name": tag,
|
||||
"body": body,
|
||||
"draft": False,
|
||||
"prerelease": False,
|
||||
},
|
||||
auth_scheme=auth_scheme,
|
||||
)
|
||||
print(f"Created Gitea release id={created['id']} for tag {tag}")
|
||||
PY
|
||||
|
||||
+34
-1
@@ -7,6 +7,36 @@ e il progetto aderisce al [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.2.2] — 2026-05-02
|
||||
|
||||
### Added
|
||||
- `tools/update_gitea_releases.py`: one-shot script to backfill Gitea release bodies with CHANGELOG content via the Gitea API
|
||||
- `tools/release-notes/`: per-version Markdown snippets used by the backfill script
|
||||
|
||||
### Changed
|
||||
- Release workflow now extracts the relevant CHANGELOG section and uses it as the GitHub Release body (`body_path`)
|
||||
- Release workflow adds a step to update the corresponding Gitea release body via API (`GITEA_TOKEN` secret)
|
||||
- All GitHub Actions upgraded to node24-native major versions (no more Node 20 deprecation warnings)
|
||||
|
||||
## [2.2.1] — 2026-05-02
|
||||
|
||||
### Added
|
||||
- Linux CI jobs for the GitHub `build` and `release` workflows using the MinGW-w64 cross-build path
|
||||
|
||||
### Changed
|
||||
- GitHub Actions workflows now opt into Node 24 for JavaScript-based actions to avoid Node 20 deprecation warnings
|
||||
|
||||
## [2.2.0] — 2026-05-02
|
||||
|
||||
### Added
|
||||
- Linux MinGW-w64 cross-build support in `build_plugin.py` via `--host linux`
|
||||
- `tools/linux/build_plugin_linux.py` for standalone Linux builds
|
||||
- Color output and progress spinner in all legacy build scripts
|
||||
|
||||
### Changed
|
||||
- `build_plugin.py` now supports both Windows (MSBuild) and Linux (MinGW-w64) targets
|
||||
- Windows build-script f-string fixes
|
||||
|
||||
## [2.1.0] — 2026-04-30
|
||||
|
||||
### Added
|
||||
@@ -36,7 +66,10 @@ e il progetto aderisce al [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
||||
- CI/CD via GitHub Actions (mirror automatico Gitea → GitHub)
|
||||
- Documentazione completa (README, CONTRIBUTING, SECURITY)
|
||||
|
||||
[Unreleased]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.1.0...HEAD
|
||||
[Unreleased]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.2.2...HEAD
|
||||
[2.2.2]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.2.1...v2.2.2
|
||||
[2.2.1]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.2.0...v2.2.1
|
||||
[2.2.0]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.1.0...v2.2.0
|
||||
[2.1.0]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.0.1...v2.1.0
|
||||
[2.0.1]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.0.0...v2.0.1
|
||||
[2.0.0]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/releases/tag/v2.0.0
|
||||
|
||||
@@ -75,14 +75,32 @@ Linux notes:
|
||||
## Repository Structure
|
||||
|
||||
```
|
||||
ns7zip/
|
||||
nsis-plugin-ns7zip/
|
||||
├── build_plugin.py # Unified build script (all versions)
|
||||
├── build_zstd.cmd # Build script for 7-zip-zstd variant
|
||||
├── rebuild_nsis7z1900-src.ps1 # Rebuilds 19.00 sources
|
||||
├── 7zip-19.00/ # 7-Zip 19.00 modified
|
||||
├── 7zip-25.01/ # 7-Zip 25.01 modified (ZIP + NSIS handler)
|
||||
└── 7zip-26.00/ # 7-Zip 26.00 modified (ZIP + NSIS handler)
|
||||
├── versions/
|
||||
│ ├── 19.00/ # 7-Zip 19.00 modified
|
||||
│ ├── 25.01/ # 7-Zip 25.01 modified (ZIP + NSIS handler)
|
||||
│ ├── 26.00/ # 7-Zip 26.00 modified (ZIP + NSIS handler)
|
||||
│ └── 7-zip-zstd/ # 7-Zip zstd fork (submodule)
|
||||
├── plugins/ # Compiled DLLs output
|
||||
├── tools/
|
||||
│ ├── fix_vcxproj.py # Project file patcher
|
||||
│ ├── update_gitea_releases.py # Backfill Gitea release bodies (one-shot)
|
||||
│ ├── release-notes/ # Per-version Markdown snippets
|
||||
│ ├── linux/ # Linux-specific build helpers
|
||||
│ └── legacy/ # Old per-version build scripts
|
||||
└── .github/workflows/
|
||||
├── build.yml # CI: Windows + Linux matrix build
|
||||
└── release.yml # Release: build artifacts + publish to GitHub & Gitea
|
||||
```
|
||||
|
||||
## CI / Release Workflow
|
||||
|
||||
- **build.yml** — runs on every push/PR; builds all three configs on Windows (MSBuild) and Linux (MinGW-w64) in parallel.
|
||||
- **release.yml** — triggered by a `v*` tag push; builds and packages artifacts, creates a GitHub Release with the relevant CHANGELOG section as body, and updates the corresponding Gitea release body via API (`GITEA_TOKEN` secret required).
|
||||
|
||||
## Changes from Original
|
||||
|
||||
### NSIS Archive Handler (25.01, 26.00)
|
||||
|
||||
+33
-4
@@ -61,21 +61,46 @@ python build_plugin.py --7zip-version 25.01
|
||||
# Toolset specifico (2022|2026|auto)
|
||||
python build_plugin.py --toolset 2022
|
||||
|
||||
# Path Linux (cross-build con MinGW-w64, 26.00)
|
||||
python build_plugin.py --host linux
|
||||
|
||||
# Stampa versione ed esce
|
||||
python build_plugin.py --version
|
||||
```
|
||||
|
||||
Note Linux:
|
||||
- Il path Linux locale supporta attualmente `--7zip-version 26.00`.
|
||||
- Richiede toolchain MinGW-w64 (`x86_64-w64-mingw32-*` e `i686-w64-mingw32-*`) e `make`.
|
||||
|
||||
## Struttura Repository
|
||||
|
||||
```
|
||||
ns7zip/
|
||||
nsis-plugin-ns7zip/
|
||||
├── build_plugin.py # Script di build unificato (tutte le versioni)
|
||||
├── build_zstd.cmd # Script di build per la variante 7-zip-zstd
|
||||
├── rebuild_nsis7z1900-src.ps1 # Ricostruisce sorgenti 19.00
|
||||
├── 7zip-19.00/ # 7-Zip 19.00 modificato
|
||||
├── 7zip-25.01/ # 7-Zip 25.01 modificato (ZIP + NSIS handler)
|
||||
└── 7zip-26.00/ # 7-Zip 26.00 modificato (ZIP + NSIS handler)
|
||||
├── versions/
|
||||
│ ├── 19.00/ # 7-Zip 19.00 modificato
|
||||
│ ├── 25.01/ # 7-Zip 25.01 modificato (ZIP + NSIS handler)
|
||||
│ ├── 26.00/ # 7-Zip 26.00 modificato (ZIP + NSIS handler)
|
||||
│ └── 7-zip-zstd/ # Fork 7-Zip zstd (submodule)
|
||||
├── plugins/ # DLL compilate
|
||||
├── tools/
|
||||
│ ├── fix_vcxproj.py # Patcher file di progetto
|
||||
│ ├── update_gitea_releases.py # Backfill body release Gitea (one-shot)
|
||||
│ ├── release-notes/ # Snippet Markdown per versione
|
||||
│ ├── linux/ # Helper build Linux
|
||||
│ └── legacy/ # Script di build legacy per-versione
|
||||
└── .github/workflows/
|
||||
├── build.yml # CI: build matrix Windows + Linux
|
||||
└── release.yml # Release: build artifact + pubblicazione su GitHub e Gitea
|
||||
```
|
||||
|
||||
## CI / Workflow di Release
|
||||
|
||||
- **build.yml** — eseguito ad ogni push/PR; compila le tre configurazioni su Windows (MSBuild) e Linux (MinGW-w64) in parallelo.
|
||||
- **release.yml** — triggerato dal push di un tag `v*`; compila e pacchettizza gli artifact, crea la GitHub Release con la sezione CHANGELOG come body, e aggiorna il body della corrispondente release Gitea via API (richiede il secret `GITEA_TOKEN`).
|
||||
|
||||
## Modifiche rispetto all'originale
|
||||
|
||||
### NSIS Archive Handler (25.01, 26.00)
|
||||
@@ -101,3 +126,7 @@ Aggiunto supporto per estrarre archivi `.exe` creati con NSIS (non presente nel
|
||||
- Igor Pavlov (7-Zip)
|
||||
- Afrow UK (Plugin originale)
|
||||
- Simone (Supporto x64, VS2022/VS2026, ZIP, NSIS handler, ExtractWithFileCallback)
|
||||
|
||||
---
|
||||
|
||||
*Vedi [README.md](README.md) per la versione in inglese.*
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# update_gitea_releases.py
|
||||
|
||||
Script one-shot per aggiornare il body delle release Gitea esistenti con il testo del CHANGELOG.
|
||||
|
||||
## Quando usarlo
|
||||
|
||||
Il workflow `release.yml` aggiorna automaticamente il body delle release **nuove** su Gitea.
|
||||
Questo script serve per le release **giĂ esistenti**, create prima che quella funzionalitĂ fosse aggiunta.
|
||||
|
||||
## Prerequisiti
|
||||
|
||||
- Python 3.8+
|
||||
- Un Gitea API token con permesso **Repository → Read and Write**
|
||||
|
||||
### Creare il token su Gitea
|
||||
|
||||
1. Gitea → avatar → **Settings** → **Applications**
|
||||
2. Sezione **"Manage Access Tokens"** → nome a piacere (es. `release-body-update`)
|
||||
3. Permission: **Repository** → `Read and Write`
|
||||
4. **Generate Token** → copia il valore (mostrato una sola volta)
|
||||
|
||||
## Uso
|
||||
|
||||
```bash
|
||||
# Tramite variabile d'ambiente
|
||||
GITEA_TOKEN=<token> python3 tools/update_gitea_releases.py
|
||||
|
||||
# Tramite argomento
|
||||
python3 tools/update_gitea_releases.py --token <token>
|
||||
```
|
||||
|
||||
## Output atteso
|
||||
|
||||
```
|
||||
[v2.0.0] recupero release... id=1, aggiorno body... OK
|
||||
[v2.0.1] recupero release... id=2, aggiorno body... OK
|
||||
[v2.1.0] recupero release... id=3, aggiorno body... OK
|
||||
[v2.2.0] recupero release... id=4, aggiorno body... OK
|
||||
[v2.2.1] recupero release... id=5, aggiorno body... OK
|
||||
```
|
||||
|
||||
Se una release non esiste su Gitea per quel tag, la riga mostra `SALTATO`.
|
||||
|
||||
## Come funziona
|
||||
|
||||
Per ogni file `tools/release-notes/vX.Y.Z.md`:
|
||||
|
||||
1. Chiama `GET /api/v1/repos/{owner}/{repo}/releases/tags/vX.Y.Z` per ottenere l'ID
|
||||
2. Chiama `PATCH /api/v1/repos/{owner}/{repo}/releases/{id}` con il body del file `.md`
|
||||
|
||||
## Aggiungere nuove versioni
|
||||
|
||||
Crea un file `tools/release-notes/vX.Y.Z.md` con il contenuto desiderato, poi riesegui lo script.
|
||||
Per le release future il workflow lo fa automaticamente — questo script non è necessario.
|
||||
@@ -0,0 +1,8 @@
|
||||
### Added
|
||||
- Prima release come repository indipendente
|
||||
- Build script unificato (`build_plugin.py`) con CLI canonica
|
||||
- CI/CD via GitHub Actions (mirror automatico Gitea → GitHub)
|
||||
- Documentazione completa (README, CONTRIBUTING, SECURITY)
|
||||
|
||||
---
|
||||
_Repository primario: vedi link Gitea nel README. Il mirror GitHub è generato automaticamente._
|
||||
@@ -0,0 +1,8 @@
|
||||
### Fixed
|
||||
- Restored `tools/legacy/` build scripts lost from repository
|
||||
- Fixed `UnicodeEncodeError` on CI: replaced Unicode checkmarks with ASCII OK/FAIL in build summary
|
||||
- Fixed MSB8020 toolset error on GitHub Actions: `build_plugin_2600_vs2026.py` now detects the installed VS toolset dynamically (falls back to v143 on VS2022 runners)
|
||||
- Build script for 26.00 selects `Nsis7z_vs2026.vcxproj` (v145) or `Nsis7z.vcxproj` (v143) based on detected toolset
|
||||
|
||||
---
|
||||
_Repository primario: vedi link Gitea nel README. Il mirror GitHub è generato automaticamente._
|
||||
@@ -0,0 +1,13 @@
|
||||
### Added
|
||||
- NSIS plugin API (`pluginapi.cpp`/`pluginapi.h`) for 7-Zip zstd build
|
||||
- `ExtractCallbackConsole` class for extraction progress and user input
|
||||
- Main extraction logic (`Main.cpp`, `MainAr.cpp`) for the zstd bundle
|
||||
- User input utilities (`UserInputUtils2`) for password handling and prompts
|
||||
- Break signal handling (`NSISBreak`) for graceful interruption
|
||||
- `Nsis7z_vs2026.vcxproj` (v145 toolset) for Visual Studio 2026 builds
|
||||
- `tools/fix_vcxproj.py` helper for project file patching
|
||||
- `versions/7-zip-zstd` submodule added
|
||||
- `build_zstd.cmd` top-level build script for the zstd variant
|
||||
|
||||
---
|
||||
_Repository primario: vedi link Gitea nel README. Il mirror GitHub è generato automaticamente._
|
||||
@@ -0,0 +1,11 @@
|
||||
### Added
|
||||
- Linux MinGW-w64 cross-build support in `build_plugin.py` via `--host linux`
|
||||
- `tools/linux/build_plugin_linux.py` for standalone Linux builds
|
||||
- Color output and progress spinner in all legacy build scripts
|
||||
|
||||
### Changed
|
||||
- `build_plugin.py` now supports both Windows (MSBuild) and Linux (MinGW-w64) targets
|
||||
- Windows build-script f-string fixes
|
||||
|
||||
---
|
||||
_Repository primario: vedi link Gitea nel README. Il mirror GitHub è generato automaticamente._
|
||||
@@ -0,0 +1,8 @@
|
||||
### Added
|
||||
- Linux CI jobs for the GitHub `build` and `release` workflows using the MinGW-w64 cross-build path
|
||||
|
||||
### Changed
|
||||
- GitHub Actions workflows now opt into Node 24 for JavaScript-based actions to avoid Node 20 deprecation warnings
|
||||
|
||||
---
|
||||
_Repository primario: vedi link Gitea nel README. Il mirror GitHub è generato automaticamente._
|
||||
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
One-shot script: aggiorna il body delle release Gitea esistenti
|
||||
con i file in tools/release-notes/.
|
||||
|
||||
Uso:
|
||||
GITEA_TOKEN=<token> python3 tools/update_gitea_releases.py
|
||||
oppure:
|
||||
python3 tools/update_gitea_releases.py --token <token>
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
from pathlib import Path
|
||||
|
||||
GITEA_BASE = "https://gitea.emulab.it/api/v1"
|
||||
REPO = "Simone/nsis-plugin-ns7zip"
|
||||
NOTES_DIR = Path(__file__).parent / "release-notes"
|
||||
|
||||
|
||||
def api(method: str, path: str, token: str, data: dict | None = None) -> dict:
|
||||
url = f"{GITEA_BASE}{path}"
|
||||
body = json.dumps(data).encode() if data else None
|
||||
req = urllib.request.Request(
|
||||
url,
|
||||
data=body,
|
||||
method=method,
|
||||
headers={
|
||||
"Authorization": f"token {token}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
},
|
||||
)
|
||||
try:
|
||||
with urllib.request.urlopen(req) as resp:
|
||||
return json.loads(resp.read())
|
||||
except urllib.error.HTTPError as e:
|
||||
print(f" HTTP {e.code} {e.reason} — {e.read().decode()}", file=sys.stderr)
|
||||
raise
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description="Update Gitea release bodies")
|
||||
parser.add_argument("--token", default=os.environ.get("GITEA_TOKEN"), help="Gitea API token")
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.token:
|
||||
sys.exit("Errore: token mancante. Usa --token oppure imposta GITEA_TOKEN.")
|
||||
|
||||
note_files = sorted(NOTES_DIR.glob("v*.md"))
|
||||
if not note_files:
|
||||
sys.exit(f"Nessun file trovato in {NOTES_DIR}")
|
||||
|
||||
for note_path in note_files:
|
||||
tag = note_path.stem # es. v2.2.1
|
||||
body = note_path.read_text(encoding="utf-8").strip()
|
||||
|
||||
print(f"[{tag}] recupero release...", end=" ", flush=True)
|
||||
try:
|
||||
release = api("GET", f"/repos/{REPO}/releases/tags/{tag}", args.token)
|
||||
except urllib.error.HTTPError:
|
||||
print("SALTATO (release non trovata)")
|
||||
continue
|
||||
|
||||
release_id = release["id"]
|
||||
print(f"id={release_id}, aggiorno body...", end=" ", flush=True)
|
||||
try:
|
||||
api("PATCH", f"/repos/{REPO}/releases/{release_id}", args.token, {"body": body})
|
||||
print("OK")
|
||||
except urllib.error.HTTPError:
|
||||
print("FALLITO")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user