Merge pull request #132 from Blazam-App/Beta-Dev #60
Workflow file for this run
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: Build Nightly | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- Beta-Nightly | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Cache Nuget Packages | |
uses: actions/cache@v1 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Setup .NET Core SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build application | |
run: dotnet publish -c Release -o bin/publish BLAZAM/BLAZAM.csproj | |
- name: Test application | |
run: dotnet test -c Release | |
- 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-nightly-v${{ env.ASSEMBLY_VERSION }}.zip | |
# For Linux | |
#- name: "Compress files" | |
# uses: montudor/action-zip@v1 | |
# with: | |
# args: zip -qq -r blazam-dev.zip bin/publish | |
- name: Update nightly release | |
uses: andelf/nightly-release@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
with: | |
tag_name: Nightly | |
name: 'Nightly' | |
prerelease: true | |
body: This release is always the latest nightly release. These versions are unstable and may break your application. You've been warned. | |
files: | | |
./blazam-nightly-v${{ env.ASSEMBLY_VERSION }}.zip |