Skip to content

Migrate OrderBy component to TypeScript #956

Migrate OrderBy component to TypeScript

Migrate OrderBy component to TypeScript #956

Workflow file for this run

name: Release
on:
push:
branches:
- master
- release-*
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-*"
pull_request:
workflow_dispatch:
env:
DOTNET_NOLOGO: true
jobs:
release:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: windows-2022
outputs:
version: ${{ steps.save-version.outputs.version }}
steps:
- name: Check for secrets
env:
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
shell: pwsh
run: exit $(If ($env:SECRETS_AVAILABLE -eq 'true') { 0 } Else { 1 })
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 7.0.x
- name: Set up Node.js
uses: actions/setup-node@v4.0.1
with:
node-version: 21.6.x
# Build AngularJS and Vue apps
- name: Build AngularJS and Vue.js
run: .\build.ps1
working-directory: src/ServicePulse.Host
- name: Run Vue component tests
run: npm run test:component
working-directory: src/ServicePulse.Host/vue
- name: Run Vue application tests
run: npm run test:application
working-directory: src/ServicePulse.Host/vue
# .NET Build and sign
- name: Build
run: dotnet build src --configuration Release
- id: save-version
name: Save version
run: echo "version=${{env.MinVerVersion}}" >> $env:GITHUB_OUTPUT
- name: Sign NuGet packages
uses: Particular/sign-nuget-packages-action@v1.0.0
with:
client-id: ${{ secrets.AZURE_KEY_VAULT_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_KEY_VAULT_TENANT_ID }}
client-secret: ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }}
certificate-name: ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE_NAME }}
- name: Setup Advanced Installer
run: |
$version = "20.2.1"
choco install advanced-installer --version=$version
& "C:\Program Files (x86)\Caphyon\Advanced Installer $version\bin\x86\AdvancedInstaller.com" /register ${{ secrets.ADVANCED_INSTALLER_LICENSE_KEY }}
- name: Prepare AIP file
run: |
$content = Get-Content -Raw -Path src/Setup/ServicePulse.aip
$content = $content -replace "replace-tenant-id", "${{ secrets.AZURE_KEY_VAULT_TENANT_ID }}" -replace "replace-app-id", "${{ secrets.AZURE_KEY_VAULT_CLIENT_ID }}" -replace "replace-cert-name", "${{ secrets.AZURE_KEY_VAULT_CERTIFICATE_NAME }}"
Set-Content src/Setup/ServicePulse.aip $content
- name: Build Windows installer
env:
AZURE_KEY_VAULT_CLIENT_SECRET: ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }}
run: dotnet build src/Setup --configuration Release
# Upload artifacts
- name: Publish artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: artifacts
path: |
assets/*
nugets/*
retention-days: 1
- name: Verify release artifact counts
shell: pwsh
run: |
$assetsCount = (Get-ChildItem -Recurse -File assets).Count
$nugetsCount = (Get-ChildItem -Recurse -File nugets).Count
$expectedAssetsCount = 1
$expectedNugetsCount = 1
if ($assetsCount -ne $expectedAssetsCount)
{
Write-Host Assets: Expected $expectedAssetsCount but found $assetsCount
exit -1
}
if ($nugetsCount -ne $expectedNugetsCount)
{
Write-Host Nugets: Expected $expectedNugetsCount but found $nugetsCount
exit -1
}
# Deploy to Octopus
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: Particular/push-octopus-package-action@v2.0.0
with:
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }}
docker:
needs: release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-2019
image-name: servicepulse-windows
dockerfile: dockerfile.iis
- os: ubuntu-20.04
image-name: servicepulse
dockerfile: dockerfile.nginx
fail-fast: false
steps:
- name: Check for secrets
env:
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
shell: pwsh
run: exit $(If ($env:SECRETS_AVAILABLE -eq 'true') { 0 } Else { 1 })
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4.0.1
with:
node-version: 21.6.x
# Build AngularJS and Vue apps
- name: Build AngularJS and Vue.js
run: .\build.ps1
shell: pwsh
working-directory: src/ServicePulse.Host
- name: Update app.constants.js
run: |
$filename = "src/ServicePulse.Host/app/js/app.constants.js"
(Get-Content $filename).replace("1.2.0", "${{ needs.release.outputs.version }}") | Set-Content $filename
shell: pwsh
- name: Build Docker image
if: ${{ matrix.image-name == 'servicepulse' || (github.event_name == 'push' && github.ref_type == 'tag') }}
run: docker build -t particular/${{ matrix.image-name }}:${{ needs.release.outputs.version }} -f ${{ matrix.dockerfile }} .
working-directory: src
- name: Login to Docker Hub
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker image
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
run: docker push particular/${{ matrix.image-name }}:${{ needs.release.outputs.version }}