Generate Release #298
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Release | |
on: | |
workflow_run: | |
workflows: | |
- 'Update Version' | |
types: | |
- 'completed' | |
defaults: | |
run: | |
shell: | | |
pwsh -noninteractive -command "try {{ $ErrorActionPreference='Stop'; . '{0}' }} catch {{ Write-Error ""FAILED: $_""; throw; }} if ((Test-Path -LiteralPath variable:\LASTEXITCODE)) {{ exit $LASTEXITCODE }}" | |
jobs: | |
build-release: # Only run on successful version update action | |
runs-on: windows-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: '${{ github.ref }}' | |
- uses: actions/setup-dotnet@main | |
with: | |
dotnet-version: 6.0.x | |
- name: Create Staging Directory | |
run: mkdir "STAGING" | |
- name: Build VolumeControl Binary (Portable Version) | |
run: dotnet publish VolumeControl -c Release -p:PublishProfile="VolumeControl/Properties/PublishProfiles/FolderProfile.pubxml" | |
- name: Stage Binary (Portable Version) | |
run: foreach($file in $((dir "publish" | where {$_.extension -in ".exe"}).Fullname)){ mv "$file" "STAGING" } | |
- name: Prepare Installer Prerequisites | |
run: git clone https://github.com/DomGries/InnoDependencyInstaller | |
- name: Build VolumeControl Binary (Installer Version) | |
run: dotnet publish VolumeControl -c Release-ForInstaller -p:PublishProfile="VolumeControl/Properties/PublishProfiles/PublishForInstaller.pubxml" | |
- name: Compile VolumeControl Installer | |
uses: Minionguyjpro/Inno-Setup-Action@v1.1.0 | |
with: | |
path: vcsetup.iss | |
options: /Opublish | |
- name: Stage Installer | |
run: foreach($file in $((dir "publish" | where {$_.extension -in ".exe"}).Fullname)){ mv "$file" "STAGING" } | |
- name: Upload Executable Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-windows | |
path: '${{github.workspace}}/STAGING/*' | |
if-no-files-found: error | |
- name: Upload SDK Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sdk | |
path: '${{github.workspace}}/publish/SDK/*' | |
if-no-files-found: error | |
# Create the release using the uploaded artifact on github: | |
create-release: | |
needs: build-release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: ${{github.workspace}} | |
- name: Debug | |
run: | | |
cd ${{github.workspace}}/sdk | |
zip -T9 ../SDK.zip ./* | |
cd ${{github.workspace}} | |
ls -lAghR | |
- name: 'Create Release' | |
uses: radj307/action-gh-release@main | |
with: | |
draft: true | |
files: | | |
build-windows/*.exe | |
SDK.zip |