ci: sposta self-test.yml e build-nsInnoUnp.yml in .gitea/workflows

This commit is contained in:
Simone
2026-05-17 00:29:53 +02:00
parent aa7e375e5d
commit efd39c2279
2 changed files with 2 additions and 5 deletions
+100
View File
@@ -0,0 +1,100 @@
# Build (Local CI) — pipeline per nsis-plugin-nsinnounp
#
# Cross-platform matrix build: runs in parallel on both windows-build (WinRM)
# and linux-build (SSH) runners using the reusable composite action.
# Uses: Simone/local-ci-system/.gitea/actions/local-ci-build@main
#
# Trigger: push su tag v*, oppure run manuale
name: Build (Local CI)
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
target: [windows, linux]
fail-fast: false
# Runner label must match config.yaml labels: windows-build or linux-build
runs-on: ${{ matrix.target }}-build
steps:
- uses: Simone/local-ci-system/.gitea/actions/local-ci-build@main
with:
build-command: 'python build_plugin.py --final --dist-dir dist'
artifact-source: 'dist'
submodules: 'true'
guest-os: ${{ matrix.target == 'linux' && 'Linux' || 'Windows' }}
# SSH URL alias configured in host ~/.ssh/config — same for both runners
repo-url: 'ssh://gitea-ci/Simone/nsis-plugin-nsinnounp.git'
# Suffix disambiguates artifact dirs: F:\CI\Artifacts\{run_id}-{attempt}-windows
job-id-suffix: '${{ matrix.target }}'
artifact-name: 'nsis-plugin-nsinnounp-${{ matrix.target }}-${{ github.ref_name }}'
# ── Publish Gitea release with build artifacts ────────────────────────────
# Runs only on tag pushes, after both matrix legs succeed.
# Requires a GITEA_TOKEN secret with repo write permissions.
release:
needs: build
if: github.ref_type == 'tag'
runs-on: windows-build
steps:
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: nsis-plugin-nsinnounp-windows-${{ github.ref_name }}
path: artifacts/windows
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: nsis-plugin-nsinnounp-linux-${{ github.ref_name }}
path: artifacts/linux
- name: Create Gitea release and upload assets
shell: powershell
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_URL: ${{ github.server_url }}
REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
#Requires -Version 5.1
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$authHeader = @{ Authorization = "token $env:GITEA_TOKEN" }
$apiBase = "$env:GITEA_URL/api/v1/repos/$env:REPO"
# Create the release (non-draft, non-prerelease)
$releaseBody = @{
tag_name = $env:TAG
name = $env:TAG
draft = $false
prerelease = $false
} | ConvertTo-Json
$jsonHeaders = $authHeader + @{ 'Content-Type' = 'application/json' }
$release = Invoke-RestMethod -Method Post -Uri "$apiBase/releases" `
-Headers $jsonHeaders -Body $releaseBody
$releaseId = $release.id
Write-Host "Release created: id=$releaseId name=$($release.name)"
# Compress each artifact directory and upload as a release asset
foreach ($target in @('windows', 'linux')) {
$srcDir = "artifacts\$target"
$zipName = "nsis-plugin-nsinnounp-$target-$env:TAG.zip"
Compress-Archive -Path "$srcDir\*" -DestinationPath $zipName -Force
$uploadUrl = "$apiBase/releases/$releaseId/assets?name=$zipName"
$uploadHeaders = $authHeader + @{ 'Content-Type' = 'application/zip' }
$zipBytes = [System.IO.File]::ReadAllBytes(
(Resolve-Path $zipName).ProviderPath)
Invoke-RestMethod -Method Post -Uri $uploadUrl `
-Headers $uploadHeaders -Body $zipBytes | Out-Null
+46
View File
@@ -0,0 +1,46 @@
# CI Self-Test (smoke) — Local CI/CD System
#
# On-demand smoke test that validates the full pipeline end-to-end:
# VM clone -> start -> IP detect -> trivial build -> artifact collect -> destroy
#
# Trigger: workflow_dispatch only (never runs on push/tag).
# Both jobs are independent — a failure in one does not cancel the other.
#
# Prerequisites (must be in place before running):
# - Runner labels: windows-build:host and linux-build:host active
# - Templates at GITEA_CI_TEMPLATE_PATH / GITEA_CI_LINUX_TEMPLATE_PATH
# - Snapshots BaseClean (Windows) and BaseClean-Linux (Linux) exist
# - ci-report-ip.service enabled in LinuxBuild2404 template
name: CI Self-Test (smoke)
on:
workflow_dispatch:
jobs:
smoke-windows:
runs-on: windows-build
steps:
- uses: Simone/local-ci-system/.gitea/actions/local-ci-build@main
with:
# Trivial no-op build: write a marker file to the CI output directory.
# The Windows build VM maps C:\CI\output as the artifact source.
build-command: 'New-Item -ItemType Directory -Path C:\CI\output -Force | Out-Null; Set-Content C:\CI\output\smoke.txt "smoke-ok"'
artifact-source: 'C:\CI\output'
guest-os: 'Windows'
job-id-suffix: 'smoke-win'
artifact-name: 'smoke-windows-${{ github.run_id }}'
smoke-linux:
runs-on: linux-build
steps:
- uses: Simone/local-ci-system/.gitea/actions/local-ci-build@main
with:
# Trivial no-op build: write a marker file to the CI output directory.
# The Linux build VM uses /opt/ci/output as the artifact source.
build-command: 'mkdir -p /opt/ci/output && echo smoke-ok > /opt/ci/output/smoke.txt'
artifact-source: '/opt/ci/output'
guest-os: 'Linux'
job-id-suffix: 'smoke-linux'
artifact-name: 'smoke-linux-${{ github.run_id }}'