@halospv3/hce.shared-config 2.2.4 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +116 -88
- package/cjs/commitlintConfig-wrapper.mjs +6 -0
- package/cjs/commitlintConfig.cjs +14 -0
- package/cjs/commitlintConfig.cjs.map +1 -0
- package/cjs/commitlintConfig.d.ts +4 -0
- package/cjs/commitlintConfig.d.ts.map +1 -0
- package/cjs/dotnet/MSBuildProject.cjs +85 -0
- package/cjs/dotnet/MSBuildProject.cjs.map +1 -0
- package/cjs/dotnet/MSBuildProject.d.ts +42 -0
- package/cjs/dotnet/MSBuildProject.d.ts.map +1 -0
- package/cjs/dotnet/MSBuildProjectProperties.cjs +22 -0
- package/cjs/dotnet/MSBuildProjectProperties.cjs.map +1 -0
- package/cjs/dotnet/MSBuildProjectProperties.d.ts +13 -0
- package/cjs/dotnet/MSBuildProjectProperties.d.ts.map +1 -0
- package/cjs/dotnet/dotnetGHPR.cjs +60 -0
- package/cjs/dotnet/dotnetGHPR.cjs.map +1 -0
- package/cjs/dotnet/dotnetGHPR.d.ts +14 -0
- package/cjs/dotnet/dotnetGHPR.d.ts.map +1 -0
- package/cjs/dotnet/dotnetGLPR.cjs +41 -0
- package/cjs/dotnet/dotnetGLPR.cjs.map +1 -0
- package/cjs/dotnet/dotnetGLPR.d.ts +13 -0
- package/cjs/dotnet/dotnetGLPR.d.ts.map +1 -0
- package/cjs/dotnet/dotnetHelpers.cjs +144 -0
- package/cjs/dotnet/dotnetHelpers.cjs.map +1 -0
- package/cjs/dotnet/dotnetHelpers.d.ts +26 -0
- package/cjs/dotnet/dotnetHelpers.d.ts.map +1 -0
- package/cjs/dotnet-wrapper.mjs +6 -0
- package/cjs/dotnet.cjs +13 -0
- package/cjs/dotnet.cjs.map +1 -0
- package/cjs/dotnet.d.ts +6 -0
- package/cjs/dotnet.d.ts.map +1 -0
- package/cjs/eslintConfig-wrapper.mjs +6 -0
- package/cjs/eslintConfig.cjs +55 -0
- package/cjs/eslintConfig.cjs.map +1 -0
- package/cjs/eslintConfig.d.ts +4 -0
- package/cjs/eslintConfig.d.ts.map +1 -0
- package/cjs/findStaticConfig-wrapper.mjs +6 -0
- package/cjs/findStaticConfig.cjs +34 -0
- package/cjs/findStaticConfig.cjs.map +1 -0
- package/cjs/findStaticConfig.d.ts +2 -0
- package/cjs/findStaticConfig.d.ts.map +1 -0
- package/cjs/index.cjs +5 -35
- package/cjs/index.cjs.map +1 -1
- package/cjs/index.d.ts +2 -5
- package/cjs/index.d.ts.map +1 -1
- package/cjs/semantic-release__git.d.cjs +2 -0
- package/cjs/semantic-release__git.d.cjs.map +1 -0
- package/cjs/semanticReleaseConfig-wrapper.mjs +6 -0
- package/cjs/semanticReleaseConfig.cjs +16 -0
- package/cjs/semanticReleaseConfig.cjs.map +1 -0
- package/cjs/semanticReleaseConfig.d.ts +4 -0
- package/cjs/semanticReleaseConfig.d.ts.map +1 -0
- package/cjs/semanticReleaseConfigDotnet-wrapper.mjs +6 -0
- package/cjs/semanticReleaseConfigDotnet.cjs +74 -0
- package/cjs/semanticReleaseConfigDotnet.cjs.map +1 -0
- package/cjs/semanticReleaseConfigDotnet.d.ts +30 -0
- package/cjs/semanticReleaseConfigDotnet.d.ts.map +1 -0
- package/cjs/setupGitPluginSpec-wrapper.mjs +6 -0
- package/cjs/setupGitPluginSpec.cjs +67 -0
- package/cjs/setupGitPluginSpec.cjs.map +1 -0
- package/cjs/setupGitPluginSpec.d.ts +18 -0
- package/cjs/setupGitPluginSpec.d.ts.map +1 -0
- package/dotnet/HCE.Shared.CI.props +8 -0
- package/dotnet/HCE.Shared.props +6 -0
- package/dotnet/HCE.Shared.targets +9 -0
- package/dotnet/PublishAll.targets +43 -0
- package/dotnet/ZipPublishDir.targets +20 -9
- package/dotnet/dotnet-build.ps1 +67 -0
- package/package.json +72 -41
- package/src/commitlintConfig.ts +15 -0
- package/src/dotnet/MSBuildProject.ts +83 -0
- package/src/dotnet/MSBuildProjectProperties.ts +28 -0
- package/src/dotnet/dotnetGHPR.ts +76 -0
- package/src/dotnet/dotnetGLPR.ts +46 -0
- package/src/dotnet/dotnetHelpers.ts +182 -0
- package/src/dotnet.ts +5 -0
- package/src/eslintConfig.ts +86 -0
- package/src/findStaticConfig.ts +31 -0
- package/src/index.ts +2 -40
- package/src/semantic-release__git.d.ts +67 -0
- package/src/semanticReleaseConfig.ts +15 -0
- package/src/semanticReleaseConfigDotnet.ts +78 -0
- package/src/setupGitPluginSpec.ts +75 -0
- package/src/tsconfig.json +10 -0
- package/static/.releaserc.yml +2 -3
- package/commitlint.config.ts +0 -10
- package/dotnet/.releaserc.cjs +0 -77
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2024 Noah Sherwin
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# HCE.Shared
|
|
2
|
+
|
|
2
3
|
Infrastructure resources shared with other HaloSPV3 repositories.
|
|
3
4
|
|
|
4
5
|
It is recommended to "install" this repo via [Node Package Manager](#npm)
|
|
5
6
|
|
|
6
7
|
## Usage
|
|
7
8
|
|
|
8
|
-
|
|
9
9
|
### 1. Install `@halospv3/hce.shared-config`
|
|
10
10
|
|
|
11
11
|
This project is packaged and published via NPM. As such...
|
|
12
|
+
|
|
12
13
|
```sh
|
|
13
14
|
npm install --save-dev @halospv3/hce.shared-config
|
|
14
15
|
```
|
|
@@ -18,53 +19,61 @@ npm install --save-dev @halospv3/hce.shared-config
|
|
|
18
19
|
```json
|
|
19
20
|
// package.json
|
|
20
21
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
]
|
|
25
|
-
}
|
|
22
|
+
"release": {
|
|
23
|
+
"extends": ["@halospv3/hce.shared-config"]
|
|
24
|
+
}
|
|
26
25
|
}
|
|
27
26
|
```
|
|
28
27
|
|
|
29
|
-
WARNING! Defining a property will
|
|
28
|
+
WARNING! Defining a property will _overwrite_ the previous value. Arrays and objects are _not_
|
|
29
|
+
merged. You can...
|
|
30
|
+
|
|
30
31
|
- Assign to top-level variables to avoid modifying the plugins array.
|
|
31
32
|
- Write your config in CJS and manually merge objects and arrays.
|
|
32
33
|
|
|
33
34
|
**Configs**
|
|
35
|
+
|
|
34
36
|
- `hce.shared-config`: [static/.releaserc.yml](static/.releaserc.yml)
|
|
35
37
|
- [dotnet/.releaserc.cjs](dotnet/.releaserc.cjs) based on [BinToss/GroupBox.Avalonia's Semantic Release config](https://github.com/BinToss/GroupBox.Avalonia).
|
|
36
38
|
|
|
37
39
|
**Notable Plugin Properties**
|
|
40
|
+
|
|
38
41
|
- [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer#options)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
- preset (set to conventionalcommits)
|
|
43
|
+
- parserOpts
|
|
44
|
+
- releaseRules
|
|
42
45
|
- [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator#options)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
- preset (set to conventionalcommits)
|
|
47
|
+
- parserOpts
|
|
48
|
+
- writerOpts
|
|
46
49
|
- [`@semantic-release/changelog`](https://github.com/semantic-release/changelog#options)
|
|
47
|
-
|
|
50
|
+
- changelogFile (default: CHANGELOG.md)
|
|
48
51
|
- [`@semantic-release/git`](https://github.com/semantic-release/git#options)
|
|
49
|
-
|
|
52
|
+
- assets (default: ['CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'])
|
|
50
53
|
- `@semantic-release/exec`
|
|
51
|
-
|
|
54
|
+
- prepareCmd
|
|
52
55
|
- [`@semantic-release/github`](https://github.com/semantic-release/github#options)
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
- assets
|
|
57
|
+
- draftRelease (default: false)
|
|
55
58
|
|
|
56
59
|
### 3. Set Up CommitLint
|
|
57
60
|
|
|
58
61
|
```json
|
|
59
62
|
// package.json
|
|
60
63
|
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
]
|
|
65
|
-
}
|
|
64
|
+
"commitlint": {
|
|
65
|
+
"extends": ["@halospv3/hce.shared-config/commitLintConfig"]
|
|
66
|
+
}
|
|
66
67
|
}
|
|
67
68
|
```
|
|
69
|
+
or
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
/* eslint-disable import/no-default-export */
|
|
73
|
+
import commitlintConfig from '@halospv3/hce.shared-config/commitLintConfig';
|
|
74
|
+
|
|
75
|
+
export default commitlintConfig;
|
|
76
|
+
```
|
|
68
77
|
|
|
69
78
|
```sh
|
|
70
79
|
npx husky
|
|
@@ -73,39 +82,39 @@ npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
|
|
|
73
82
|
|
|
74
83
|
### 4. (dotnet) Add/Edit Directory.Build.props
|
|
75
84
|
|
|
76
|
-
|
|
77
85
|
> Example Directory.Build.props from [BinToss/GroupBox.Avalonia](https://github.com/BinToss/GroupBox.Avalonia)
|
|
78
86
|
|
|
79
87
|
```xml
|
|
80
88
|
<Project>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
<PropertyGroup>
|
|
90
|
+
<RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</RepoRoot>
|
|
91
|
+
<HCESharedDir Condition="'$(HCESharedDir)' == ''">$(RepoRoot)node_modules/@halospv3/hce.shared-config/</HCESharedDir>
|
|
92
|
+
<GitVersion_Path Condition="'$(GitVersion_Path)' == ''">$(HCESharedDir)GitVersion.yml</GitVersion_Path>
|
|
93
|
+
<AvaloniaVersion>11.0.10</AvaloniaVersion>
|
|
94
|
+
</PropertyGroup>
|
|
95
|
+
|
|
96
|
+
<PropertyGroup Condition="'$(CI)' == 'true'">
|
|
97
|
+
<Configuration>Release</Configuration>
|
|
98
|
+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
|
99
|
+
<Deterministic>true</Deterministic>
|
|
100
|
+
</PropertyGroup>
|
|
101
|
+
|
|
102
|
+
<Import Project="$(HCESharedDir)/dotnet/ZipPublishDir.targets" />
|
|
95
103
|
</Project>
|
|
96
104
|
```
|
|
97
105
|
|
|
98
|
-
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
Add the file `Directory.Build.props` to your repository's root directory or solution directory if
|
|
109
|
+
you haven't already. Then, add the following properties:
|
|
99
110
|
|
|
100
|
-
Add the file `Directory.Build.props` to your repository's root directory or solution directory if you haven't already.
|
|
101
|
-
Then, add the following properties:
|
|
102
111
|
```xml
|
|
103
112
|
<Project> <!-- Minimal requirements for dotnet/msbuild integration -->
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
<Import Project="./node_modules/@halospv3/hce.shared-config/dotnet/ZipPublishDir.targets" />
|
|
114
|
+
<PropertyGroup>
|
|
115
|
+
<ProjectRootDir>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</ProjectRootDir>
|
|
116
|
+
<HCESharedDir>$(ProjectRootDir)/node_modules/@halospv3/hce.shared-config/</HCESharedDir>
|
|
117
|
+
</PropertyGroup>
|
|
109
118
|
</Project>
|
|
110
119
|
```
|
|
111
120
|
|
|
@@ -119,30 +128,40 @@ These may evaluate to the following:
|
|
|
119
128
|
|
|
120
129
|
#### CI/CD-Only Properties
|
|
121
130
|
|
|
122
|
-
If you want properties set only in a CI/CD environment (e.g. a GitHub workflow), add the following
|
|
131
|
+
If you want properties set only in a CI/CD environment (e.g. a GitHub workflow), add the following
|
|
132
|
+
conditional property group to the props file:
|
|
133
|
+
|
|
123
134
|
```xml, diff
|
|
124
135
|
<Project>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
<PropertyGroup>
|
|
137
|
+
...
|
|
138
|
+
</PropertyGroup>
|
|
139
|
+
|
|
140
|
+
<PropertyGroup Condition=" '$(CI)' == 'true' ">
|
|
141
|
+
<Configuration>Release</Configuration>
|
|
142
|
+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
|
143
|
+
<Deterministic>true</Deterministic>
|
|
144
|
+
</PropertyGroup>
|
|
134
145
|
</Project>
|
|
135
146
|
```
|
|
136
|
-
|
|
147
|
+
|
|
148
|
+
> Any properties added to this conditional property group will only be evaluated when `$(CI)` is
|
|
149
|
+
> defined either as a property or as an environment variable. This is most useful for properties
|
|
150
|
+
> such as `ContinuousIntegrationBuild`.
|
|
137
151
|
|
|
138
152
|
#### GitVersion
|
|
139
153
|
|
|
140
|
-
By default, GitVersion will search only the "current directory" for `GitVersion.yml`. GitVersion has
|
|
154
|
+
By default, GitVersion will search only the "current directory" for `GitVersion.yml`. GitVersion has
|
|
155
|
+
a lesser-known CLI argument, "Path" which allows users to specify the path to `GitVersion.yml`. The
|
|
156
|
+
NuGet package `GitVersion.MSBuild` exposes this as the read-write property `$(GitVersion_Path)`.
|
|
157
|
+
|
|
158
|
+
If you're satisfied by [dotnet/GitVersion.yml](dotnet/GitVersion.yml), you can configure GitVersion
|
|
159
|
+
to use this config file. GitVersion does not have 'extend' functionality typical of Node.js
|
|
160
|
+
packages.
|
|
141
161
|
|
|
142
|
-
If you're satisfied by [dotnet/GitVersion.yml](dotnet/GitVersion.yml), you can configure GitVersion to use this config file. GitVersion does not have 'extend' functionality typical of Node.js packages.
|
|
143
162
|
```xml
|
|
144
163
|
<PropertyGroup>
|
|
145
|
-
|
|
164
|
+
<GitVersion_Path>$(ProjectRootDir)/node_modules/@halospv3/hce.shared-config/dotnet/GitVersion.yml</GitVersion_Path>
|
|
146
165
|
</PropertyGroup>
|
|
147
166
|
```
|
|
148
167
|
|
|
@@ -150,24 +169,31 @@ If you're satisfied by [dotnet/GitVersion.yml](dotnet/GitVersion.yml), you can c
|
|
|
150
169
|
|
|
151
170
|
### Need your VersionInfo before the actual release?
|
|
152
171
|
|
|
153
|
-
If you want to use this information in other Semantic Release steps, you'll need
|
|
172
|
+
If you want to use this information in other Semantic Release steps, you'll need
|
|
173
|
+
`semantic-release-export-data`.
|
|
174
|
+
|
|
154
175
|
```sh
|
|
155
176
|
npm i -D semantic-release-export-data
|
|
156
177
|
```
|
|
157
178
|
|
|
158
179
|
Run the following to preview the version:
|
|
180
|
+
|
|
159
181
|
```sh
|
|
160
182
|
npx semantic-release --dry-run --plugins "@semantic-release/commit-analyzer,semantic-release-export-data"
|
|
161
183
|
```
|
|
162
|
-
If the first plugin doesn't run into any issues and infers a version bump from unreleased commits, it will print the next version to the console.
|
|
163
|
-
The [second plugin](https://github.com/felipecrs/semantic-release-export-data#readme) will export the next version and other information as GitHub Action Step exports.
|
|
164
184
|
|
|
165
|
-
|
|
185
|
+
If the first plugin doesn't run into any issues and infers a version bump from unreleased commits,
|
|
186
|
+
it will print the next version to the console. The
|
|
187
|
+
[second plugin](https://github.com/felipecrs/semantic-release-export-data#readme) will export the
|
|
188
|
+
next version and other information as GitHub Action Step exports.
|
|
189
|
+
|
|
190
|
+
### Don't intend to publish a Node package?
|
|
166
191
|
|
|
167
192
|
Add the following to `package.json`:
|
|
193
|
+
|
|
168
194
|
```json
|
|
169
195
|
{
|
|
170
|
-
|
|
196
|
+
"private": true,
|
|
171
197
|
}
|
|
172
198
|
```
|
|
173
199
|
|
|
@@ -177,33 +203,35 @@ Add the following to `package.json`:
|
|
|
177
203
|
|
|
178
204
|
```yml
|
|
179
205
|
jobs:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
206
|
+
release:
|
|
207
|
+
steps:
|
|
208
|
+
- uses: actions/checkout@v3
|
|
209
|
+
- name: dotnet build/publish; copy release artifacts to './publish/'
|
|
210
|
+
uses: ./node_modules/@halospv3/hce.shared/dotnet/.github/workflows/dotnet-release.yml
|
|
211
|
+
with:
|
|
212
|
+
projects:
|
|
213
|
+
- src/lib/lib.csproj
|
|
214
|
+
- src/lib-sample/sample.csproj
|
|
189
215
|
```
|
|
190
216
|
|
|
191
217
|
### Ease Semantic Release Configuration
|
|
192
218
|
|
|
193
|
-
JSON/YAML configs
|
|
194
|
-
|
|
219
|
+
JSON/YAML configs _could_ have merge-edit capabilities driven by data from custom, top-level
|
|
220
|
+
properties. Each property would contain the command moniker and the config data (parameters) similar
|
|
221
|
+
to RPC implementations. This will require quite a bit of datatype validation behind the scenes.
|
|
222
|
+
|
|
195
223
|
```json
|
|
196
224
|
{
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
225
|
+
"modify_plugins": {
|
|
226
|
+
"op": "Append",
|
|
227
|
+
"data": [
|
|
228
|
+
[
|
|
229
|
+
"newplugin",
|
|
230
|
+
{
|
|
231
|
+
"newpluginoption": true
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
]
|
|
235
|
+
}
|
|
208
236
|
}
|
|
209
|
-
```
|
|
237
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// CJS compatibility; This enum cannot be required.
|
|
4
|
+
const disabled = 0;
|
|
5
|
+
const commitlintConfig = {
|
|
6
|
+
extends: ['@commitlint/config-conventional'],
|
|
7
|
+
rules: {
|
|
8
|
+
'body-max-line-length': [disabled],
|
|
9
|
+
'footer-max-line-length': [disabled],
|
|
10
|
+
'header-max-length': [disabled]
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
module.exports = commitlintConfig;
|
|
14
|
+
//# sourceMappingURL=commitlintConfig.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commitlintConfig.cjs","sources":["../src/commitlintConfig.ts"],"sourcesContent":null,"names":[],"mappings":";;AAAA;AACA,MAAM,QAAQ,GAAG,CAAC,CAAC;AACd,MAAC,gBAAgB,GAAG;AACzB,EAAE,OAAO,EAAE,CAAC,iCAAiC,CAAC;AAC9C,EAAE,KAAK,EAAE;AACT,IAAI,sBAAsB,EAAE,CAAC,QAAQ,CAAC;AACtC,IAAI,wBAAwB,EAAE,CAAC,QAAQ,CAAC;AACxC,IAAI,mBAAmB,EAAE,CAAC,QAAQ,CAAC;AACnC,GAAG;AACH;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commitlintConfig.d.ts","sourceRoot":"","sources":["../src/commitlintConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI7E,QAAA,MAAM,gBAAgB,EAAE,UAOvB,CAAC;AAGF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
const node_child_process = require('node:child_process');
|
|
9
|
+
const MSBuildProjectProperties = require('./MSBuildProjectProperties.cjs');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* All pre-defined properties of {@link MSBuildProjectProperties} except FullPath
|
|
13
|
+
*/
|
|
14
|
+
const MSBuildProjectPreDefinedProperties = Object.keys(new MSBuildProjectProperties.MSBuildProjectProperties('', false)).filter(p => p !== 'FullPath');
|
|
15
|
+
/** @todo Experimental and may be removed in a later release.
|
|
16
|
+
* A cache for your evaluated MSBuild Projects.
|
|
17
|
+
*/
|
|
18
|
+
const MSBuildEvaluatedProjects = [];
|
|
19
|
+
class MSBuildProject {
|
|
20
|
+
Properties;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param fullPath The full path of the .NET MSBuild project file.
|
|
25
|
+
* @param customProperties MSBuild properties to evaluate in addition to those pre-defined in {@link MSBuildProjectProperties}
|
|
26
|
+
*/
|
|
27
|
+
constructor(fullPath, customProperties) {
|
|
28
|
+
// super();
|
|
29
|
+
this.Properties = MSBuildProject.evaluateProperties(fullPath, customProperties ?? []);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* `dotnet msbuild src -getProperty:TargetFramework -getProperty:TargetFrameworks -getProperty:RuntimeIdentifiers -getProperty:IsTrimmable`
|
|
35
|
+
*
|
|
36
|
+
* ...produces...
|
|
37
|
+
*
|
|
38
|
+
* ```json
|
|
39
|
+
* {
|
|
40
|
+
* "Properties": {
|
|
41
|
+
* "TargetFramework": "net6.0",
|
|
42
|
+
* "TargetFrameworks": "",
|
|
43
|
+
* "RuntimeIdentifiers": "win7-x64;win7-x86;win-arm64;linux-x64;linux-arm64",
|
|
44
|
+
* "IsTrimmable": "true",
|
|
45
|
+
* }
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* ...which can can be parsed like...
|
|
50
|
+
* ```js
|
|
51
|
+
* var ridArray = JSON.parse(out).Properties.RuntimeIdentifiers.split(';');
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
static evaluateProperties(fullPath, properties) {
|
|
55
|
+
const evaluatedProps = new MSBuildProjectProperties.MSBuildProjectProperties(fullPath);
|
|
56
|
+
|
|
57
|
+
// if a default prop isn't in properties, add it
|
|
58
|
+
const defaultProps = MSBuildProjectPreDefinedProperties;
|
|
59
|
+
for (const defaultProp of defaultProps) {
|
|
60
|
+
if (!properties.includes(defaultProp)) properties.push(defaultProp);
|
|
61
|
+
}
|
|
62
|
+
const getPropArgs = properties.map(propName => `-getProperty:${propName}`);
|
|
63
|
+
// should return a single value OR string-encoded JSON object with 'Properties' object-type property.
|
|
64
|
+
const out = node_child_process.execFileSync('dotnet', ['msbuild', evaluatedProps.FullPath, ...getPropArgs], {
|
|
65
|
+
encoding: 'utf8',
|
|
66
|
+
stdio: 'pipe'
|
|
67
|
+
}).trim();
|
|
68
|
+
if (out.startsWith('MSBUILD : error')) throw new Error(out);
|
|
69
|
+
let props;
|
|
70
|
+
if (out.startsWith('{')) {
|
|
71
|
+
const obj = JSON.parse(out);
|
|
72
|
+
if ("Properties" in obj && typeof obj.Properties === 'object' && obj.Properties !== null) props = obj.Properties;
|
|
73
|
+
throw new Error('When evaluating properties with MSBuild, "Properties" could not be found in the deserialized JSON object.');
|
|
74
|
+
} else {
|
|
75
|
+
props = {
|
|
76
|
+
[properties[0]]: out.trim()
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return _objectSpread(_objectSpread({}, evaluatedProps), props);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.MSBuildEvaluatedProjects = MSBuildEvaluatedProjects;
|
|
83
|
+
exports.MSBuildProject = MSBuildProject;
|
|
84
|
+
exports.MSBuildProjectPreDefinedProperties = MSBuildProjectPreDefinedProperties;
|
|
85
|
+
//# sourceMappingURL=MSBuildProject.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSBuildProject.cjs","sources":["../../src/dotnet/MSBuildProject.ts"],"sourcesContent":null,"names":["MSBuildProjectProperties","execFileSync"],"mappings":";;;;;AAGA;AACA;AACA;AACY,MAAC,kCAAkC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAIA,iDAAwB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE;AACrI;AACA;AACA;AACY,MAAC,wBAAwB,GAAG,GAAG;AACpC,MAAM,cAAc,CAAC;AAC5B,EAAE,UAAU,CAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,QAAQ,EAAE,gBAAgB,EAAE;AAC1C;AACA,IAAI,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,IAAI,EAAE,CAAC,CAAC;AAC1F,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,kBAAkB,CAAC,QAAQ,EAAE,UAAU,EAAE;AAClD,IAAI,MAAM,cAAc,GAAG,IAAIA,iDAAwB,CAAC,QAAQ,CAAC,CAAC;AAClE;AACA;AACA,IAAI,MAAM,YAAY,GAAG,kCAAkC,CAAC;AAC5D,IAAI,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;AAC5C,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC1E,KAAK;AACL,IAAI,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC/E;AACA,IAAI,MAAM,GAAG,GAAGC,+BAAY,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,QAAQ,EAAE,GAAG,WAAW,CAAC,EAAE;AAC7F,MAAM,QAAQ,EAAE,MAAM;AACtB,MAAM,KAAK,EAAE,MAAM;AACnB,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AACd,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;AAChE,IAAI,IAAI,KAAK,CAAC;AACd,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAC7B,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAClC,MAAM,IAAI,YAAY,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,KAAK,IAAI,EAAE,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC;AACvH,MAAM,MAAM,IAAI,KAAK,CAAC,2GAA2G,CAAC,CAAC;AACnI,KAAK,MAAM;AACX,MAAM,KAAK,GAAG;AACd,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE;AACnC,OAAO,CAAC;AACR,KAAK;AACL,IAAI,OAAO;AACX,MAAM,GAAG,cAAc;AACvB,MAAM,GAAG,KAAK;AACd,KAAK,CAAC;AACN,GAAG;AACH;;;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MSBuildProjectProperties } from './MSBuildProjectProperties.js';
|
|
2
|
+
/**
|
|
3
|
+
* All pre-defined properties of {@link MSBuildProjectProperties} except FullPath
|
|
4
|
+
*/
|
|
5
|
+
export declare const MSBuildProjectPreDefinedProperties: string[];
|
|
6
|
+
/** @todo Experimental and may be removed in a later release.
|
|
7
|
+
* A cache for your evaluated MSBuild Projects.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MSBuildEvaluatedProjects: MSBuildProject[];
|
|
10
|
+
export declare class MSBuildProject {
|
|
11
|
+
Properties: MSBuildProjectProperties;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param fullPath The full path of the .NET MSBuild project file.
|
|
15
|
+
* @param customProperties MSBuild properties to evaluate in addition to those pre-defined in {@link MSBuildProjectProperties}
|
|
16
|
+
*/
|
|
17
|
+
constructor(fullPath: string, customProperties?: string[]);
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* `dotnet msbuild src -getProperty:TargetFramework -getProperty:TargetFrameworks -getProperty:RuntimeIdentifiers -getProperty:IsTrimmable`
|
|
21
|
+
*
|
|
22
|
+
* ...produces...
|
|
23
|
+
*
|
|
24
|
+
* ```json
|
|
25
|
+
* {
|
|
26
|
+
* "Properties": {
|
|
27
|
+
* "TargetFramework": "net6.0",
|
|
28
|
+
* "TargetFrameworks": "",
|
|
29
|
+
* "RuntimeIdentifiers": "win7-x64;win7-x86;win-arm64;linux-x64;linux-arm64",
|
|
30
|
+
* "IsTrimmable": "true",
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* ...which can can be parsed like...
|
|
36
|
+
* ```js
|
|
37
|
+
* var ridArray = JSON.parse(out).Properties.RuntimeIdentifiers.split(';');
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
static evaluateProperties(fullPath: string, properties: string[]): MSBuildProjectProperties;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=MSBuildProject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSBuildProject.d.ts","sourceRoot":"","sources":["../../src/dotnet/MSBuildProject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,kCAAkC,UAEd,CAAC;AAClC;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,cAAc,EAAO,CAAC;AAE7D,qBAAa,cAAc;IAC1B,UAAU,EAAE,wBAAwB,CAAC;IAErC;;;;OAIG;gBACS,QAAQ,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,EAAE;IAKzD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,wBAAwB;CAiC3F"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const node_fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Known properties. Additional properties may be added upon request.
|
|
8
|
+
*/
|
|
9
|
+
class MSBuildProjectProperties {
|
|
10
|
+
FullPath = '';
|
|
11
|
+
TargetFramework = '';
|
|
12
|
+
TargetFrameworks = '';
|
|
13
|
+
RuntimeIdentifier = '';
|
|
14
|
+
RuntimeIdentifiers = '';
|
|
15
|
+
constructor(fullPath, exists = true) {
|
|
16
|
+
this.FullPath = fullPath;
|
|
17
|
+
if (!path.isAbsolute(this.FullPath)) this.FullPath = path.resolve(this.FullPath);
|
|
18
|
+
if (!node_fs.existsSync(this.FullPath) && exists) throw new Error(`Project ${path.basename(this.FullPath)} could not be found at "${this.FullPath}"`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.MSBuildProjectProperties = MSBuildProjectProperties;
|
|
22
|
+
//# sourceMappingURL=MSBuildProjectProperties.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSBuildProjectProperties.cjs","sources":["../../src/dotnet/MSBuildProjectProperties.ts"],"sourcesContent":null,"names":["isAbsolute","resolve","existsSync","basename"],"mappings":";;;;;AAGA;AACA;AACA;AACO,MAAM,wBAAwB,CAAC;AACtC,EAAE,QAAQ,GAAG,EAAE,CAAC;AAChB,EAAE,eAAe,GAAG,EAAE,CAAC;AACvB,EAAE,gBAAgB,GAAG,EAAE,CAAC;AACxB,EAAE,iBAAiB,GAAG,EAAE,CAAC;AACzB,EAAE,kBAAkB,GAAG,EAAE,CAAC;AAC1B,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE;AACvC,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,IAAI,IAAI,CAACA,eAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAGC,YAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC3E,IAAI,IAAI,CAACC,kBAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,QAAQ,EAAEC,aAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,wBAAwB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7I,GAAG;AACH;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Known properties. Additional properties may be added upon request.
|
|
3
|
+
*/
|
|
4
|
+
export declare class MSBuildProjectProperties {
|
|
5
|
+
[Property: string]: string;
|
|
6
|
+
FullPath: string;
|
|
7
|
+
TargetFramework: string;
|
|
8
|
+
TargetFrameworks: string;
|
|
9
|
+
RuntimeIdentifier: string;
|
|
10
|
+
RuntimeIdentifiers: string;
|
|
11
|
+
constructor(fullPath: string, exists?: boolean);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=MSBuildProjectProperties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSBuildProjectProperties.d.ts","sourceRoot":"","sources":["../../src/dotnet/MSBuildProjectProperties.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,wBAAwB;IACpC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B,QAAQ,SAAM;IAEd,eAAe,SAAM;IAErB,gBAAgB,SAAM;IAEtB,iBAAiB,SAAM;IAEvB,kBAAkB,SAAM;gBAEZ,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAO;CAQ3C"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// todo: support custom base URL for private GitHub instances
|
|
4
|
+
async function tokenCanWritePackages(tokenEnvVar) {
|
|
5
|
+
const tokenValue = process.env[tokenEnvVar];
|
|
6
|
+
if (tokenValue === undefined) throw new TypeError(`The environment variable ${tokenEnvVar} is undefined!`);
|
|
7
|
+
const reqH = {
|
|
8
|
+
authorization: `token ${tokenValue}`
|
|
9
|
+
};
|
|
10
|
+
// CJS compatibility - import { request } from '@octokit/request
|
|
11
|
+
const request = (await import('@octokit/request')).request;
|
|
12
|
+
const response = await request('GET /', {
|
|
13
|
+
headers: reqH
|
|
14
|
+
});
|
|
15
|
+
const scopes = response.headers['x-oauth-scopes'];
|
|
16
|
+
if (scopes) {
|
|
17
|
+
return scopes.includes('write:packages') || scopes.includes('write:packages');
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const GITHUB_REPOSITORY_OWNER = process.env.GITHUB_REPOSITORY_OWNER;
|
|
22
|
+
const nugetGitHubUrlBase = 'https://nuget.pkg.github.com';
|
|
23
|
+
const nugetGitHubUrl = GITHUB_REPOSITORY_OWNER ? `${nugetGitHubUrlBase}/${GITHUB_REPOSITORY_OWNER}/index.json` : undefined;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get a {@link NuGetRegistryInfo} for pushing to your GitHub Packages NuGet registry.
|
|
27
|
+
* todo: add support for private, custom GitHub instances. Token is only validated against github.com.
|
|
28
|
+
* @export
|
|
29
|
+
* @param {string} [tokenEnvVar="GITHUB_TOKEN"] The name of environment variable storing the GitHub Packages NuGet registry API key. Defaults to `"GITHUB_TOKEN"`;
|
|
30
|
+
* @param {string} [url=tokenEnvVar] The url of the GitHub Packages NuGet registry. Defaults to {@link nugetGitHubUrl}.
|
|
31
|
+
* @returns {(NuGetRegistryInfo | undefined)} a {@link NuGetRegistryInfo} object if {@link tokenEnvVar} and {@link url} are defined. Else, `undefined`.
|
|
32
|
+
* note: `url` defaults to job's repository owner's GitHub registry in GitHub Actions workflow. If GITHUB_REPOSITORY_OWNER is not defined, then an error will be logged and `undefined` will be returned.
|
|
33
|
+
*/
|
|
34
|
+
async function getGithubNugetRegistryPair(tokenEnvVar = 'GITHUB_TOKEN', url = nugetGitHubUrl) {
|
|
35
|
+
// yes, this is stupid. No, I won't change it.
|
|
36
|
+
const isTokenDefined = process.env[tokenEnvVar] !== undefined;
|
|
37
|
+
const isUrlDefined = url !== undefined;
|
|
38
|
+
const canTokenWritePackages = isTokenDefined ? await tokenCanWritePackages(tokenEnvVar) : false;
|
|
39
|
+
const errors = [];
|
|
40
|
+
if (!isTokenDefined) errors.push(new Error(`The environment variable ${tokenEnvVar} was specified as the source of the token to push a NuGet package to GitHub, but the environment variable does not exist.`));
|
|
41
|
+
if (!isUrlDefined) {
|
|
42
|
+
errors.push(new Error('The url for the GitHub Packages NuGet registry was undefined.\n' + 'If running in a GitHub Actions workflow, something is seriously wrong.\n' + 'If running in a different CI/CD pipeline and you wish to cross-push to GHPR, ensure GITHUB_REPOSITORY_OWNER is set correctly.\n'));
|
|
43
|
+
}
|
|
44
|
+
if (!canTokenWritePackages) {
|
|
45
|
+
// yes, this is a critical error that should be fixed before Semantic Release can succeed.
|
|
46
|
+
// yes, this is incredibly irritating to deal with in local runs.
|
|
47
|
+
errors.push(new Error('The provided GitHub token has insufficient permissions or is a fine-grained permissions token. Only class Personal Access Tokens (classic) or workflow tokens with `repo` or `write:packages` permission can push a package.'));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// conditions checked so `url` is certainly defined
|
|
51
|
+
if (isTokenDefined && isUrlDefined && canTokenWritePackages) return {
|
|
52
|
+
tokenEnvVar,
|
|
53
|
+
url
|
|
54
|
+
};
|
|
55
|
+
throw new Error(`One more more errors occurred when getting GHPR url-token pair. Errors:\n${errors.map(v => v.message).join('\n')}`);
|
|
56
|
+
}
|
|
57
|
+
exports.getGithubNugetRegistryPair = getGithubNugetRegistryPair;
|
|
58
|
+
exports.nugetGitHubUrl = nugetGitHubUrl;
|
|
59
|
+
exports.nugetGitHubUrlBase = nugetGitHubUrlBase;
|
|
60
|
+
//# sourceMappingURL=dotnetGHPR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnetGHPR.cjs","sources":["../../src/dotnet/dotnetGHPR.ts"],"sourcesContent":null,"names":[],"mappings":";;AAAA;AACA,eAAe,qBAAqB,CAAC,WAAW,EAAE;AAClD,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC9C,EAAE,IAAI,UAAU,KAAK,SAAS,EAAE,MAAM,IAAI,SAAS,CAAC,CAAC,yBAAyB,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;AAC7G,EAAE,MAAM,IAAI,GAAG;AACf,IAAI,aAAa,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;AACA,EAAE,MAAM,OAAO,GAAG,CAAC,MAAM,OAAO,kBAAkB,CAAC,EAAE,OAAO,CAAC;AAC7D,EAAE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE;AAC1C,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACpD,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,OAAO,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAClF,GAAG;AACH,EAAE,OAAO,KAAK,CAAC;AACf,CAAC;AACD,MAAM;AACN,EAAE,uBAAuB;AACzB,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;AACJ,MAAC,kBAAkB,GAAG,+BAA+B;AACrD,MAAC,cAAc,GAAG,uBAAuB,GAAG,CAAC,EAAE,kBAAkB,CAAC,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAAG,UAAU;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,0BAA0B,CAAC,WAAW,GAAG,cAAc,EAAE,GAAG,GAAG,cAAc,EAAE;AACrG;AACA,EAAE,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,SAAS,CAAC;AAChE,EAAE,MAAM,YAAY,GAAG,GAAG,KAAK,SAAS,CAAC;AACzC,EAAE,MAAM,qBAAqB,GAAG,cAAc,GAAG,MAAM,qBAAqB,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;AAClG,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,yBAAyB,EAAE,WAAW,CAAC,yHAAyH,CAAC,CAAC,CAAC,CAAC;AAClN,EAAE,IAAI,CAAC,YAAY,EAAE;AACrB,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,iEAAiE,GAAG,0EAA0E,GAAG,iIAAiI,CAAC,CAAC,CAAC;AAC/S,GAAG;AACH,EAAE,IAAI,CAAC,qBAAqB,EAAE;AAC9B;AACA;AACA,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,8NAA8N,CAAC,CAAC,CAAC;AAC3P,GAAG;AACH;AACA;AACA,EAAE,IAAI,cAAc,IAAI,YAAY,IAAI,qBAAqB,EAAE,OAAO;AACtE,IAAI,WAAW;AACf,IAAI,GAAG;AACP,GAAG,CAAC;AACJ,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,yEAAyE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACvI;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NuGetRegistryInfo } from './dotnetHelpers.js';
|
|
2
|
+
export declare const nugetGitHubUrlBase = "https://nuget.pkg.github.com";
|
|
3
|
+
export declare const nugetGitHubUrl: string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Get a {@link NuGetRegistryInfo} for pushing to your GitHub Packages NuGet registry.
|
|
6
|
+
* todo: add support for private, custom GitHub instances. Token is only validated against github.com.
|
|
7
|
+
* @export
|
|
8
|
+
* @param {string} [tokenEnvVar="GITHUB_TOKEN"] The name of environment variable storing the GitHub Packages NuGet registry API key. Defaults to `"GITHUB_TOKEN"`;
|
|
9
|
+
* @param {string} [url=tokenEnvVar] The url of the GitHub Packages NuGet registry. Defaults to {@link nugetGitHubUrl}.
|
|
10
|
+
* @returns {(NuGetRegistryInfo | undefined)} a {@link NuGetRegistryInfo} object if {@link tokenEnvVar} and {@link url} are defined. Else, `undefined`.
|
|
11
|
+
* note: `url` defaults to job's repository owner's GitHub registry in GitHub Actions workflow. If GITHUB_REPOSITORY_OWNER is not defined, then an error will be logged and `undefined` will be returned.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getGithubNugetRegistryPair(tokenEnvVar?: string, url?: string | undefined): Promise<NuGetRegistryInfo | undefined>;
|
|
14
|
+
//# sourceMappingURL=dotnetGHPR.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnetGHPR.d.ts","sourceRoot":"","sources":["../../src/dotnet/dotnetGHPR.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAoB5D,eAAO,MAAM,kBAAkB,iCAAiC,CAAC;AACjE,eAAO,MAAM,cAAc,oBAEf,CAAC;AAEb;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,CAC/C,WAAW,SAAiB,EAC5B,GAAG,GAAE,MAAM,GAAG,SAA0B,GACtC,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAsCxC"}
|