Skip to content

Bump version to 2.5.8 #7

Bump version to 2.5.8

Bump version to 2.5.8 #7

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'v*.*.*' # Triggers on version tags like v2.5.8, v3.0.1, etc.
permissions:
contents: write
jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from tag
id: get_version
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$version = $tag -replace '^v', ''
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
echo "TAG=$tag" >> $env:GITHUB_OUTPUT
echo "Version: $version"
- name: Get latest .NET SDK version
id: dotnet_version
shell: pwsh
run: |
# Fetch latest .NET 10.0 LTS version
try {
$response = Invoke-RestMethod -Uri "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/10.0/releases.json"
$latestRelease = $response.'latest-release'
$latestSdk = $response.'latest-sdk'
Write-Host "Latest .NET 10.0 SDK: $latestSdk"
Write-Host "Latest .NET 10.0 Runtime: $latestRelease"
echo "SDK_VERSION=$latestSdk" >> $env:GITHUB_OUTPUT
echo "RUNTIME_VERSION=$latestRelease" >> $env:GITHUB_OUTPUT
} catch {
Write-Host "Using fallback version: 10.0.x"
echo "SDK_VERSION=10.0.x" >> $env:GITHUB_OUTPUT
echo "RUNTIME_VERSION=10.0.x" >> $env:GITHUB_OUTPUT
}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ steps.dotnet_version.outputs.SDK_VERSION }}
- name: Restore dependencies
run: dotnet restore FFmpegInstaller.csproj
- name: Build application
run: |
dotnet publish FFmpegInstaller.csproj `
-c Release `
-r win-x64 `
--self-contained true `
-p:PublishSingleFile=true `
-p:PublishReadyToRun=true `
-p:PublishTrimmed=true `
-p:_SuppressWinFormsTrimError=true `
-p:EnableCompressionInSingleFile=true `
-o ./publish
- name: Verify build output
shell: pwsh
run: |
if (Test-Path "./publish/FFmpegInstaller.exe") {
Write-Host "✓ FFmpegInstaller.exe found"
$fileSize = (Get-Item "./publish/FFmpegInstaller.exe").Length / 1MB
Write-Host "File size: $($fileSize.ToString('F2')) MB"
# Copy to root for release
Copy-Item "./publish/FFmpegInstaller.exe" "./FFmpegInstaller.exe"
} else {
Write-Error "FFmpegInstaller.exe not found!"
exit 1
}
- name: Generate release notes
id: release_notes
shell: pwsh
run: |
$version = "${{ steps.get_version.outputs.VERSION }}"
# Get commit messages since last tag
$lastTag = git describe --tags --abbrev=0 HEAD^ 2>$null
if ($lastTag) {
$commits = git log "$lastTag..HEAD" --pretty=format:"- %s" --no-merges
} else {
$commits = git log --pretty=format:"- %s" --no-merges -10
}
$notes = @"
## FFmpeg Installer v$version
**Full Changelog**: https://github.com/${{ github.repository }}/compare/$lastTag...${{ steps.get_version.outputs.TAG }}
"@
# Save to file for GitHub release
$notes | Out-File -FilePath release_notes.md -Encoding utf8
Write-Host "Release notes generated successfully"
- name: Calculate checksum
shell: pwsh
run: |
# Calculate SHA256 for the exe
$exeHash = (Get-FileHash -Path "./FFmpegInstaller.exe" -Algorithm SHA256).Hash
Write-Host "FFmpegInstaller.exe SHA256: $exeHash"
# Append to release notes
@"
## SHA256 Checksum
``````
$exeHash FFmpegInstaller.exe
``````
"@ | Out-File -FilePath release_notes.md -Append -Encoding utf8
- name: Create Draft Release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
name: "FFmpeg Installer v${{ steps.get_version.outputs.VERSION }}"
tag_name: ${{ steps.get_version.outputs.TAG }}
body_path: release_notes.md
files: |
FFmpegInstaller.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ffmpeg-installer-v${{ steps.get_version.outputs.VERSION }}
path: |
FFmpegInstaller.exe
release_notes.md
retention-days: 30