Files
WinDeckHelper/.github/workflows/main.yml
T
2025-03-13 13:13:51 +02:00

71 lines
2.2 KiB
YAML

name: Upload EXE to Existing Release
on:
release:
types: [published] # Срабатывает при создании релиза через GitHub интерфейс или API
jobs:
upload:
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install WinRAR
run: |
choco install winrar -y
shell: powershell
- name: Get Release Version
run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
shell: bash
- name: Create SFX archive
run: |
$SFXConfig = @"
Path=%TEMP%\Windeckhelper
Silent=1
Overwrite=1
Setup=PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& .\Windeckhelper.ps1"
TempMode=1
Title=WindeckHelper Installer
Icon=Windeckicon.ico
"@
Set-Content -Path "sfx_config.txt" -Value $SFXConfig
$exeName = "WindeckHelper_${{ github.event.release.tag_name }}.exe"
$exePath = "C:\path\to\your\directory\$exeName" # Полный путь к .exe файлу
Write-Host "Creating EXE at $exePath" # Логирование пути
& "C:\Program Files\WinRAR\WinRAR.exe" a -r -sfx -z"sfx_config.txt" $exePath *
echo "EXE_NAME=$exePath" >> $GITHUB_ENV
Write-Host "EXE file created at $exePath"
shell: powershell
- name: Log EXE_NAME value
run: |
echo "EXE_NAME is: ${{ env.EXE_NAME }}"
shell: bash
- name: Verify EXE exists
run: |
echo "Checking if EXE exists at: ${{ env.EXE_NAME }}" # Логирование перед проверкой
if (Test-Path "${{ env.EXE_NAME }}") {
Write-Host "EXE file found: ${{ env.EXE_NAME }}"
} else {
Write-Host "EXE file not found!"
exit 1
}
shell: powershell
- name: Upload EXE to Release Assets
uses: softprops/action-gh-release@v2
with:
files: ${{ env.EXE_NAME }}
tag_name: ${{ github.event.release.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}