-
Notifications
You must be signed in to change notification settings - Fork 97
143 lines (126 loc) · 5.03 KB
/
publish-internal.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
142
143
name: publish-internal
on:
workflow_dispatch:
inputs:
release-type:
type: choice
options:
- InternalPreview
- PublicPreview
- Stable
default: InternalPreview
description: The type of release (determines version format)
required: false
version-core:
type: string
default: "4.2.0"
description: The core part of the version string
required: false
prerelease-version:
type: string
default: preview01
description: The prerelease suffix appended after the core version
required: false
prerelease-suffix:
type: string
default: ""
description: Additional prerelease suffix appended after the build number
required: false
signature-type:
type: choice
options:
- DotNetFoundation
- Riganti
default: DotNetFoundation
description: The signature to be used to sign the packages.
required: false
jobs:
read-input:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: set-version
run: >
if [[ "${{ inputs.release-type }}" == 'InternalPreview' ]]; then
VERSION="${{ inputs.version-core}}-${{ inputs.prerelease-version }}-${{ github.run_id }}";
elif [[ "${{ inputs.release-type }}" == 'PublicPreview' ]]; then
VERSION="${{ inputs.version-core}}-${{ inputs.prerelease-version }}-final";
elif [[ "${{ inputs.release-type }}" == 'Stable' ]]; then
VERSION="${{ inputs.version-core}}";
else
echo "Unknown release type '${{ inputs.release-type }}'.";
exit 1;
fi;
if [[ ( "${{ inputs.release-type }}" == 'InternalPreview' || "${{ inputs.release-type }}" == 'PublicPreview' ) && -n "${{ inputs.prerelease-suffix }}" ]]; then
VERSION="${VERSION}-${{ inputs.prerelease-suffix }}";
fi;
echo "$VERSION";
echo "version=$VERSION" >> $GITHUB_OUTPUT;
outputs:
version: ${{ steps.set-version.outputs.version }}
publish-nuget-packages:
runs-on: windows-2022
needs: read-input
steps:
- uses: actions/checkout@v3
- name: Set up
uses: ./.github/setup
- name: Add internal NuGet feed
run: ./ci/scripts/Add-InternalNuGetFeed.ps1 `
-internalFeed "${{ secrets.AZURE_ARTIFACTS_FEED }}" `
-internalFeedUser "${{ secrets.AZURE_ARTIFACTS_USERNAME }}" `
-internalFeedPat "${{ secrets.AZURE_ARTIFACTS_PAT }}"
- name: Publish NuGet packages (.NET Foundation)
if: ${{ inputs.signature-type == 'DotNetFoundation' }}
run: ./ci/scripts/Publish-NuGetPackages.ps1 `
-root "${{ github.workspace }}" `
-version "${{ needs.read-input.outputs.version }}" `
-signatureType "DotNetFoundation" `
-dnfUrl "${{ secrets.SIGN_DNF_KEYVAULT_URL }}" `
-dnfClientId "${{ secrets.SIGN_DNF_CLIENT_ID }}" `
-dnfTenantId "${{ secrets.SIGN_DNF_TENANT_ID }}" `
-dnfSecret "${{ secrets.SIGN_DNF_SECRET }}" `
-dnfCertificate "${{ secrets.SIGN_DNF_CERTIFICATE_NAME }}"
- name: Publish NuGet packages (Riganti)
if: ${{ inputs.signature-type == 'Riganti' }}
run: ./ci/scripts/Publish-NuGetPackages.ps1 `
-root "${{ github.workspace }}" `
-version "${{ needs.read-input.outputs.version }}" `
-signatureType "Riganti" `
-rigantiUrl "${{ secrets.SIGN_RIGANTI_KEYVAULT_URL }}" `
-rigantiClientId "${{ secrets.SIGN_RIGANTI_CLIENT_ID }}" `
-rigantiTenantId "${{ secrets.SIGN_RIGANTI_TENANT_ID }}" `
-rigantiSecret "${{ secrets.SIGN_RIGANTI_SECRET }}" `
-rigantiCertificate "${{ secrets.SIGN_RIGANTI_CERTIFICATE_NAME }}"
publish-dotvvm-types:
runs-on: windows-2022
needs: read-input
steps:
- uses: actions/checkout@v3
- name: Set up
uses: ./.github/setup
- name: Build Framework
uses: ./.github/pack
with:
project: src/Framework/Framework
- name: Build dotvvm-types
run: npm run tsc-types
working-directory: src/Framework/Framework
- name: Compose dotvvm-types
run: >
mkdir types;
cp "${{ github.workspace }}/src/Framework/Framework/obj/typescript-types/dotvvm.d.ts" types/index.d.ts;
npm version "${{ needs.read-input.outputs.version }}" --no-git-tag-version;
cat "${{ github.workspace }}/ci/scripts/npm/dotvvm-types/package.json";
working-directory: ci/scripts/npm/dotvvm-types
- name: Set internal npm registry
run: >
./ci/scripts/Set-NpmRegistry.ps1 `
-targetDirectory "./ci/scripts/npm/dotvvm-types" `
-registry "${{ secrets.INTERNAL_NPM_REGISTRY }}" `
-pat "${{ secrets.INTERNAL_NPM_PAT }}" `
-username "${{ secrets.INTERNAL_NPM_USERNAME }}" `
-email "${{ secrets.INTERNAL_NPM_EMAIL }}"
- name: Publish dotvvm-types
run: npm publish
working-directory: ci/scripts/npm/dotvvm-types