clean up pipeline scripts and allow usage of semantic versioning (#268) #21
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: Check-release-workflow | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- release | ||
types: [ opened, synchronize, reopened, edited ] | ||
push: | ||
branches: | ||
- main | ||
- release | ||
jobs: | ||
Check-release: | ||
runs-on: windows-latest | ||
if: "!contains(github.event.pull_request.body, 'The workflow check-release was intentionally skipped.')" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set timestamp | ||
id: setTimestamp | ||
run: | | ||
$timestamp = (Get-Date).ToString("yyyy-MM-ddTHH-mm-ssZ") | ||
if ($timestamp -match "'|\"|:") | ||
{ | ||
throw "Unexpected characters in timestamp: $timestamp" | ||
} | ||
echo "::set-output name=timestamp::$timestamp" | ||
shell: pwsh | ||
- name: Install .NET Core 6.0 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '6.0.x' | ||
- name: Infer the version | ||
id: inferVersion | ||
run: | | ||
$version = .\GetVersion.ps1 -suffix alpha | ||
Write-Output "::set-output name=version::$version" | ||
shell: pwsh | ||
- name: Build for release | ||
description: | ||
working-directory: src | ||
run: .\BuildForRelease.ps1 | ||
shell: pwsh | ||
- name: Package | ||
working-directory: src | ||
run: .\PackageRelease.ps1 -version ${{ steps.inferVersion.outputs.version }} | ||
shell: pwsh | ||
- name: Upload AasxServerBlazor | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: AasxServerBlazor.LATEST.${{ steps.inferVersion.outputs.version }}.${{ steps.setTimestamp.outputs.timestamp }} | ||
path: artefacts/release/LATEST.alpha/AasxServerBlazor.zip | ||
- name: Upload AasxServerAspNetCore | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: AasxServerAspNetCore.LATEST.${{ steps.inferVersion.outputs.version }}.${{ steps.setTimestamp.outputs.timestamp }} | ||
path: artefacts/release/LATEST.alpha/AasxServerAspNetCore.zip | ||
# Uncomment the following steps if you need to upload the AasxServerWindows artifact | ||
# - name: Upload AasxServerWindows | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: AasxServerWindows.LATEST.${{ steps.inferVersion.outputs.version }}.${{ steps.setTimestamp.outputs.timestamp }} | ||
# path: artefacts/release/LATEST.alpha/AasxServerWindows.zip |