-
Notifications
You must be signed in to change notification settings - Fork 22
141 lines (117 loc) · 4.49 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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 }}