mirror of
https://github.com/anejolov/WinDeckHelper.git
synced 2026-06-13 04:05:06 +03:00
69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
name: Auto Release on Push to Main
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install WinRAR
|
|
run: |
|
|
choco install winrar -y
|
|
shell: powershell
|
|
|
|
- name: Get Commit SHA
|
|
run: echo "COMMIT_SHA=${{ github.sha }}" >> $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_${{ env.COMMIT_SHA }}.exe"
|
|
& "C:\Program Files\WinRAR\WinRAR.exe" a -r -sfx -z"sfx_config.txt" $exeName *
|
|
|
|
echo "EXE_NAME=$exeName" >> $GITHUB_ENV
|
|
Write-Host "EXE file created at $exeName"
|
|
shell: powershell
|
|
|
|
- name: Verify EXE exists
|
|
run: |
|
|
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: Create GitHub Release
|
|
id: create_release
|
|
run: |
|
|
gh release create ${{ env.COMMIT_SHA }} ${{ env.EXE_NAME }} --title "Release ${{ env.COMMIT_SHA }}" --notes "Automated release generated from commit ${{ env.COMMIT_SHA }}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload EXE to Release Assets
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: ${{ env.EXE_NAME }}
|
|
tag_name: ${{ env.COMMIT_SHA }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|