Skip to content

Merge pull request #660 from Blazam-App/v1-Nightly #50

Merge pull request #660 from Blazam-App/v1-Nightly

Merge pull request #660 from Blazam-App/v1-Nightly #50

name: Publish and Release Stable
on:
workflow_dispatch:
push:
branches:
- v1-Stable
jobs:
build:
runs-on: windows-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET Core SDK 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x
- name: Restore dependencies
run: dotnet restore
- name: Build application (Debug)
run: dotnet build -c Debug
- name: Setup Playwright
shell: pwsh
run: |
PlaywrightTests/bin/Debug/net8.0/playwright.ps1 install;
- name: Test application
run: dotnet test -c Release
- name: Build application (Release)
run: dotnet publish -c Release -o bin/publish BLAZAM/BLAZAM.csproj
- name: Set assembly version as environment variable
shell: pwsh
id: get_version
run: |
$file = "bin\Publish\BLAZAM.dll";
$versionInfo = (Get-Item $file).VersionInfo
$fileVersion = $versionInfo.FileVersion
$productVersion = $versionInfo.ProductVersion
echo "ASSEMBLY_VERSION=$fileVersion.$productVersion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Show Version
run: echo $env.ASSEMBLY_VERSION
- name: Compress files
run: Compress-Archive -Path bin\Publish\* -DestinationPath blazam-stable-v${{ env.ASSEMBLY_VERSION }}.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: Release-v${{ env.ASSEMBLY_VERSION }}
release_name: Release - v${{ env.ASSEMBLY_VERSION }}
body: ""
draft: true
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: blazam-stable-v${{ env.ASSEMBLY_VERSION }}.zip
asset_name: blazam-stable-v${{ env.ASSEMBLY_VERSION }}.zip
asset_content_type: application/zip