Skip to content

release

release #29

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
prereleaseSlug:
description: 'Prerelease slug (optional)'
required: false
default: ''
type: choice
options:
- rc
- beta
- ''
jobs:
meta:
uses: ./.github/workflows/part-compute-version.yml
secrets: inherit
with:
prereleaseSlug: ${{ inputs.prereleaseSlug }}
checkTagIsUnique: true
build:
uses: ./.github/workflows/part-build.yml
secrets: inherit
needs: meta
with:
COALESCE_VERSION: ${{ needs.meta.outputs.COALESCE_VERSION }}
validate-template:
runs-on: ubuntu-latest
name: "test template: ${{matrix.testCase}}"
needs: [meta, build]
strategy:
matrix:
testCase:
# Nothing:
- ""
# Everything (except tenancy):
- "--Identity --MicrosoftAuth --GoogleAuth --UserPictures --AuditLogs --ExampleModel --DarkMode --TrackingBase --AppInsights --OpenAPI"
# Assorted partial variants:
- "--Identity --UserPictures --TrackingBase"
- "--Identity --MicrosoftAuth --AuditLogs"
# Tenancy variants:
- "--Identity --Tenancy --TenantCreateExternal --GoogleAuth"
- "--Identity --Tenancy --TenantCreateSelf --TenantMemberInvites --AuditLogs --LocalAuth --EmailSendGrid"
- "--Identity --Tenancy --TenantCreateAdmin --TenantMemberInvites --MicrosoftAuth --LocalAuth --EmailAzure"
defaults:
run:
shell: pwsh
working-directory: ./templates/Coalesce.Vue.Template
env:
COALESCE_VERSION: ${{ needs.meta.outputs.COALESCE_VERSION }}
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/artifacts
- name: Add local nuget source
run: |
dotnet nuget add source "${{ github.workspace }}/artifacts/packages" --name "local-nuget"
# Install the coalesce packages that we just built so we can validate that the template
# works correctly with the version of Coalesce that we're releasing (which is also the version
# that will get substituted into the template when we build it in part-template-build).
# This isn't part of part-template-build because we want to validate before we publish any new versions.
- name: "Install newly built Coalesce packages"
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
echo $env:COALESCE_VERSION
ls ${{ github.workspace }}/artifacts
$filePath = "./content/Directory.Build.props"
$newVersion = "<CoalesceVersion>$env:COALESCE_VERSION</CoalesceVersion>"
(Get-Content $filePath) -replace '<CoalesceVersion>.*?<\/CoalesceVersion>', $newVersion | Set-Content $filePath
cat $filePath
cd ./content/*.Web
npm i $(Get-ChildItem -Path "${{ github.workspace }}/artifacts/coalesce-vue*.tgz").FullName --save
npm i $(Get-ChildItem -Path "${{ github.workspace }}/artifacts/coalesce-vue-vue3*.tgz").FullName --save
cat package.json
- name: TestLocal
run: ./TestLocal.ps1 "${{ matrix.testCase }}"
publish:
uses: ./.github/workflows/part-publish.yml
needs: [build, validate-template]
secrets: inherit
create-release:
runs-on: ubuntu-latest
needs: [meta, publish]
steps:
- uses: actions/checkout@v4
- uses: rickstaa/action-create-tag@v1
if: ${{ success() && !inputs.prereleaseSlug }}
with:
tag: ${{ needs.meta.outputs.COALESCE_VERSION }}
build-template:
uses: ./.github/workflows/part-template-build.yml
secrets: inherit
# Versioned template build depends upon NPM packages being published,
# and nuget packages existing as local artifacts (since Nuget.org is so slow
# to make new packages available, we consume the local artifacts instead of waiting).
needs: [meta, publish]
with:
COALESCE_VERSION: ${{ needs.meta.outputs.COALESCE_VERSION }}
publish-template:
runs-on: ubuntu-latest
needs: [build-template]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: template-packages
- name: dotnet nuget push
run: dotnet nuget push "**/*.nupkg" -s https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }}