Merge pull request #350 from Blazam-App/Beta-Nightly #29
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: Publish and Release Stable | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- Beta-Stable | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup .NET Core SDK 6 | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.x | |
- 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.RELEASE_TOKEN }} | |
with: | |
tag_name: Stable-v${{ env.ASSEMBLY_VERSION }} | |
release_name: Stable - 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.RELEASE_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 |