@halospv3/hce.shared-config 2.6.4 → 3.0.0-develop.2
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/CHANGELOG.md +356 -101
- package/README.md +100 -87
- package/dotnet/.github/workflows/_unit_test.yml +6 -3
- package/dotnet/.github/workflows/ci.yml +2 -2
- package/dotnet/.github/workflows/dotnet-release.yml +31 -28
- package/dotnet/.github/workflows/sample-dotnet-build.yml +16 -11
- package/dotnet/ExecNupkgDeterministicator.README.md +20 -0
- package/dotnet/ExecNupkgDeterministicator.targets +173 -0
- package/dotnet/GitVersion.yml +3 -1
- package/dotnet/GitVersion6.0.yml +3 -1
- package/dotnet/HCE.Shared.sln +34 -0
- package/dotnet/HCE.Shared.targets +1 -0
- package/dotnet/PublishAll.targets +2 -0
- package/dotnet/SignAfterPack.targets +104 -0
- package/dotnet/samples/HCE.Shared.DeterministicNupkg/Dummy.cs +6 -0
- package/dotnet/samples/HCE.Shared.DeterministicNupkg/HCE.Shared.DeterministicNupkg.csproj +21 -0
- package/dotnet/samples/HCE.Shared.SignAfterPack/Class1.cs +6 -0
- package/dotnet/samples/HCE.Shared.SignAfterPack/HCE.Shared.SignAfterPack.csproj +21 -0
- package/dotnet/samples/HCE.Shared.SignAfterPack/sampleCert.samplepfx +0 -0
- package/dotnet/samples/README.md +7 -0
- package/package.json +72 -73
- package/src/CaseInsensitiveMap.ts +34 -0
- package/src/commitlintConfig.ts +17 -9
- package/src/debug.ts +3 -3
- package/src/dotnet/GithubNugetRegistryInfo.ts +60 -0
- package/src/dotnet/GitlabNugetRegistryInfo.ts +112 -0
- package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +44 -0
- package/src/dotnet/MSBuildProject.ts +557 -76
- package/src/dotnet/MSBuildProjectProperties.ts +280 -15
- package/src/dotnet/NugetProjectProperties.ts +608 -0
- package/src/dotnet/NugetRegistryInfo.ts +939 -0
- package/src/dotnet/helpers.ts +448 -0
- package/src/eslintConfig.ts +174 -71
- package/src/index.ts +1 -3
- package/src/semantic-release__commit-analyzer.d.ts +44 -38
- package/src/semantic-release__exec.d.ts +15 -0
- package/src/semantic-release__git.d.ts +85 -88
- package/src/semantic-release__github.d.ts +139 -139
- package/src/semanticReleaseConfig.ts +106 -47
- package/src/semanticReleaseConfigDotnet.ts +394 -104
- package/src/setupGitPluginSpec.ts +149 -57
- package/src/tsconfig.json +8 -8
- package/src/utils/Exact.ts +49 -0
- package/src/utils/GracefulRecursion.d.ts +12 -0
- package/src/utils/env.ts +44 -0
- package/src/utils/execAsync.ts +77 -0
- package/src/utils/miscTypes.ts +17 -0
- package/src/utils/reflection/FunctionLike.d.ts +17 -0
- package/src/utils/reflection/GetterDescriptor.d.ts +8 -0
- package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +32 -0
- package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +20 -0
- package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +17 -0
- package/src/utils/reflection/OwnKeyOf.d.ts +20 -0
- package/src/utils/reflection/OwnPropertyDescriptorMap.d.ts +82 -0
- package/src/utils/reflection/PropertyDescriptorMap.d.ts +15 -0
- package/src/utils/reflection/filterForGetters.ts +59 -0
- package/src/utils/reflection/getOwnPropertyDescriptors.ts +52 -0
- package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +127 -0
- package/src/utils/reflection/getPrototypeChainOf.ts +85 -0
- package/src/utils/reflection/getPrototypeOf.ts +12 -0
- package/src/utils/reflection/inheritance.ts +262 -0
- package/src/utils/reflection/isConstructor.ts +74 -0
- package/src/utils/reflection/isGetterDescriptor.ts +11 -0
- package/src/utils/reflection/listOwnGetters.ts +80 -0
- package/src/utils/reflection.ts +18 -0
- package/cjs/commitlintConfig-wrapper.mjs +0 -6
- package/cjs/commitlintConfig.cjs +0 -14
- package/cjs/commitlintConfig.cjs.map +0 -1
- package/cjs/commitlintConfig.d.ts +0 -4
- package/cjs/commitlintConfig.d.ts.map +0 -1
- package/cjs/debug.cjs +0 -13
- package/cjs/debug.cjs.map +0 -1
- package/cjs/debug.d.ts +0 -4
- package/cjs/debug.d.ts.map +0 -1
- package/cjs/dotnet/MSBuildProject.cjs +0 -84
- package/cjs/dotnet/MSBuildProject.cjs.map +0 -1
- package/cjs/dotnet/MSBuildProject.d.ts +0 -42
- package/cjs/dotnet/MSBuildProject.d.ts.map +0 -1
- package/cjs/dotnet/MSBuildProjectProperties.cjs +0 -22
- package/cjs/dotnet/MSBuildProjectProperties.cjs.map +0 -1
- package/cjs/dotnet/MSBuildProjectProperties.d.ts +0 -13
- package/cjs/dotnet/MSBuildProjectProperties.d.ts.map +0 -1
- package/cjs/dotnet/createDummyNupkg.cjs +0 -26
- package/cjs/dotnet/createDummyNupkg.cjs.map +0 -1
- package/cjs/dotnet/createDummyNupkg.d.ts +0 -2
- package/cjs/dotnet/createDummyNupkg.d.ts.map +0 -1
- package/cjs/dotnet/dotnetGHPR.cjs +0 -173
- package/cjs/dotnet/dotnetGHPR.cjs.map +0 -1
- package/cjs/dotnet/dotnetGHPR.d.ts +0 -37
- package/cjs/dotnet/dotnetGHPR.d.ts.map +0 -1
- package/cjs/dotnet/dotnetGLPR.cjs +0 -41
- package/cjs/dotnet/dotnetGLPR.cjs.map +0 -1
- package/cjs/dotnet/dotnetGLPR.d.ts +0 -13
- package/cjs/dotnet/dotnetGLPR.d.ts.map +0 -1
- package/cjs/dotnet/dotnetHelpers.cjs +0 -141
- package/cjs/dotnet/dotnetHelpers.cjs.map +0 -1
- package/cjs/dotnet/dotnetHelpers.d.ts +0 -26
- package/cjs/dotnet/dotnetHelpers.d.ts.map +0 -1
- package/cjs/dotnet-wrapper.mjs +0 -6
- package/cjs/dotnet.cjs +0 -15
- package/cjs/dotnet.cjs.map +0 -1
- package/cjs/dotnet.d.ts +0 -7
- package/cjs/dotnet.d.ts.map +0 -1
- package/cjs/envUtils-wrapper.mjs +0 -6
- package/cjs/envUtils.cjs +0 -37
- package/cjs/envUtils.cjs.map +0 -1
- package/cjs/envUtils.d.ts +0 -15
- package/cjs/envUtils.d.ts.map +0 -1
- package/cjs/eslintConfig-wrapper.mjs +0 -6
- package/cjs/eslintConfig.cjs +0 -52
- package/cjs/eslintConfig.cjs.map +0 -1
- package/cjs/eslintConfig.d.ts +0 -3
- package/cjs/eslintConfig.d.ts.map +0 -1
- package/cjs/findStaticConfig-wrapper.mjs +0 -6
- package/cjs/findStaticConfig.cjs +0 -34
- package/cjs/findStaticConfig.cjs.map +0 -1
- package/cjs/findStaticConfig.d.ts +0 -2
- package/cjs/findStaticConfig.d.ts.map +0 -1
- package/cjs/index-wrapper.mjs +0 -6
- package/cjs/index.cjs +0 -10
- package/cjs/index.cjs.map +0 -1
- package/cjs/index.d.ts +0 -5
- package/cjs/index.d.ts.map +0 -1
- package/cjs/semantic-release__commit-analyzer.d.cjs +0 -2
- package/cjs/semantic-release__commit-analyzer.d.cjs.map +0 -1
- package/cjs/semantic-release__git.d.cjs +0 -2
- package/cjs/semantic-release__git.d.cjs.map +0 -1
- package/cjs/semantic-release__github.d.cjs +0 -2
- package/cjs/semantic-release__github.d.cjs.map +0 -1
- package/cjs/semanticReleaseConfig-wrapper.mjs +0 -6
- package/cjs/semanticReleaseConfig.cjs +0 -33
- package/cjs/semanticReleaseConfig.cjs.map +0 -1
- package/cjs/semanticReleaseConfig.d.ts +0 -4
- package/cjs/semanticReleaseConfig.d.ts.map +0 -1
- package/cjs/semanticReleaseConfigDotnet-wrapper.mjs +0 -7
- package/cjs/semanticReleaseConfigDotnet.cjs +0 -112
- package/cjs/semanticReleaseConfigDotnet.cjs.map +0 -1
- package/cjs/semanticReleaseConfigDotnet.d.ts +0 -51
- package/cjs/semanticReleaseConfigDotnet.d.ts.map +0 -1
- package/cjs/setupGitPluginSpec-wrapper.mjs +0 -6
- package/cjs/setupGitPluginSpec.cjs +0 -67
- package/cjs/setupGitPluginSpec.cjs.map +0 -1
- package/cjs/setupGitPluginSpec.d.ts +0 -19
- package/cjs/setupGitPluginSpec.d.ts.map +0 -1
- package/src/dotnet/createDummyNupkg.ts +0 -30
- package/src/dotnet/dotnetGHPR.ts +0 -232
- package/src/dotnet/dotnetGLPR.ts +0 -46
- package/src/dotnet/dotnetHelpers.ts +0 -184
- package/src/dotnet.ts +0 -6
- package/src/envUtils.ts +0 -36
- package/src/findStaticConfig.ts +0 -31
- package/static/.releaserc.yml +0 -35
package/README.md
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
# HCE.Shared
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
> Activity is held up by a rewrite for the `next/3.0.0` branch.
|
|
6
|
-
>
|
|
7
|
-
> A fix for the `2.x` branch may be feasible if all that's wrong is async functions in CJS. The `2.x` release channel will not receive feature updates, but fixes and dependency updates are acceptable.
|
|
3
|
+
[](https://github.com/HaloSPV3/HCE.Shared/actions/workflows/npm-release.yml)
|
|
8
4
|
|
|
9
5
|
Infrastructure resources shared with other HaloSPV3 repositories.
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
**NOTE**
|
|
8
|
+
HCE.Shared's API offers convenience and flexibility not present in similar .NET/NuGet-publishing NPM packages, but this project is incredibly messy. You'll find many traces of scrapped or unfinished ideas in the form of both documentation and code. These wrinkles will be ironed out before `3.x` is merged into `main`.
|
|
12
9
|
|
|
13
10
|
## Usage
|
|
14
11
|
|
|
@@ -26,7 +23,7 @@ WARNING! Defining a property will _overwrite_ the previous value. Arrays and
|
|
|
26
23
|
objects are _not_ merged. You can...
|
|
27
24
|
|
|
28
25
|
- Assign to certain top-level variables (e.g. `options.preset`) to avoid
|
|
29
|
-
modifying the plugins array. Caveat: only
|
|
26
|
+
modifying the plugins array. Caveat: only _some_ plugins read these properties.
|
|
30
27
|
- Write your config in MJS; It is recommended you use
|
|
31
28
|
[deepmerge](https://www.npmjs.com/package/deepmerge) to recursively merge
|
|
32
29
|
objects and arrays instead of using `extends`. Doing so will allow your IDE to
|
|
@@ -41,11 +38,11 @@ objects are _not_ merged. You can...
|
|
|
41
38
|
> - Configures [`@semantic-release/git`](https://github.com/semantic-release/git) to add README.md and CHANGELOG.md in a release commit if they have changes. Uses GitHub job's token to commit.
|
|
42
39
|
> - Configures [`@semantic-release/github`](https://github.com/semantic-release/github) to release all files found in `$PWD/publish`.
|
|
43
40
|
|
|
44
|
-
##### Usage
|
|
41
|
+
##### Base Config - Usage
|
|
45
42
|
|
|
46
43
|
```js
|
|
47
44
|
// releaserc.config.js
|
|
48
|
-
import hceSharedConfig from
|
|
45
|
+
import hceSharedConfig from '@halospv3/hce.shared-config';
|
|
49
46
|
|
|
50
47
|
// modify it however you wish before the export statement!
|
|
51
48
|
|
|
@@ -55,55 +52,62 @@ export default hceSharedConfig;
|
|
|
55
52
|
```js
|
|
56
53
|
// releaserc.config.js
|
|
57
54
|
export default {
|
|
58
|
-
|
|
59
|
-
}
|
|
55
|
+
extends: ['@halospv3/hce.shared-config'],
|
|
56
|
+
};
|
|
60
57
|
```
|
|
61
58
|
|
|
62
59
|
```json
|
|
63
60
|
// package.json
|
|
64
61
|
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
"release": {
|
|
63
|
+
"extends": ["@halospv3/hce.shared-config"]
|
|
64
|
+
}
|
|
68
65
|
}
|
|
69
66
|
```
|
|
70
67
|
|
|
71
68
|
#### Dotnet Config
|
|
72
69
|
|
|
73
70
|
> An extension of our base config.
|
|
71
|
+
>
|
|
74
72
|
> Exports a function with parameters for 'projects to pack' and 'projects to push (to nuget)'.
|
|
75
73
|
> Although `@halospv3/hce.shared-config/semanticReleaseConfigDotnet` can be used
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
> via `extends` and configured via the `PROJECTS_TO_PUBLISH` and
|
|
75
|
+
> `PROJECTS_TO_PACK_AND_PUSH` environment variables, it is recommended to call
|
|
76
|
+
> the function and pass it parameters so errors are caught before they reach
|
|
77
|
+
> production.
|
|
80
78
|
>
|
|
81
79
|
> Differences to the base config:
|
|
80
|
+
>
|
|
82
81
|
> - Utilizes `@semantic-release/exec` for shell commands.
|
|
83
82
|
> - Executes `dotnet publish` and `dotnet pack` upon the configured projects during the `prepare` step.
|
|
84
83
|
> - (WIP) Executes `dotnet nuget sign` during `prepare` upon the `dotnet pack` outputs if `projectsToPackAndPush` is not set to `false` (default: `[]`).
|
|
85
84
|
> - Executes `dotnet nuget push` during the `publish` step.
|
|
86
85
|
|
|
87
|
-
##### Usage
|
|
86
|
+
##### Dotnet Config - Usage
|
|
88
87
|
|
|
89
|
-
|
|
88
|
+
TODO: add "non-best-guess" config example
|
|
89
|
+
|
|
90
|
+
For a basic "best-guess" config...
|
|
91
|
+
|
|
92
|
+
```ts
|
|
90
93
|
// releaserc.config.js
|
|
91
|
-
|
|
94
|
+
// TODO: getConfig was removed. Update instructions!
|
|
95
|
+
import { getConfig } from '@halospv3/hce.shared-config/semanticReleaseConfigDotnet';
|
|
92
96
|
|
|
93
97
|
/* Caveat: semantic-release will version and release all specified projects under the same Git tags and GitHub releases.
|
|
94
98
|
* To version and release them separately, use [https://github.com/pmowrer/semantic-release-monorepo](semantic-release-monorepo).
|
|
95
99
|
*/
|
|
96
100
|
|
|
97
|
-
/* `prepareCmd` will contain command lines to publish
|
|
101
|
+
/* `prepareCmd` will contain command lines to publish
|
|
98
102
|
* both Library and Sample to your GitHub release.
|
|
99
103
|
* Their `TargetFrameworks` and `RuntimeIdentifiers`
|
|
100
|
-
* properties will be evaluated and a command line
|
|
101
|
-
* will be added for each unique combination,
|
|
104
|
+
* properties will be evaluated and a command line
|
|
105
|
+
* will be added for each unique combination,
|
|
102
106
|
* _regardless of compatibility and intended combinations_.
|
|
103
107
|
*/
|
|
104
108
|
const projectsToPublish = [
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
'./Library/Library.csproj',
|
|
110
|
+
'./Sample/Sample.csproj',
|
|
107
111
|
];
|
|
108
112
|
/*
|
|
109
113
|
* `prepareCmd` will also contain `dotnet pack` and
|
|
@@ -111,28 +115,29 @@ const projectsToPublish = [
|
|
|
111
115
|
* `publishCmd` will contain `dotnet nuget push` commands
|
|
112
116
|
* to push Library to Nuget.org and GitHub Package Registry.
|
|
113
117
|
*/
|
|
114
|
-
const projectsToPackAndPush = [
|
|
118
|
+
const projectsToPackAndPush = ['./Library/Library.csproj'];
|
|
115
119
|
|
|
116
120
|
// runs getConfig and exports its return value
|
|
117
|
-
export default getConfig(projectsToPublish, projectsToPackAndPush)
|
|
121
|
+
export default await getConfig(projectsToPublish, projectsToPackAndPush);
|
|
118
122
|
```
|
|
119
123
|
|
|
120
124
|
###### `extends` key in a javascript config file
|
|
121
125
|
|
|
122
126
|
Using `extends` is NOT recommended, but I won't stop you.
|
|
123
127
|
Your projects' paths must be assigned to environment variables. See [Dotnet Config](#dotnet-config).
|
|
128
|
+
|
|
124
129
|
```js
|
|
125
130
|
// releaserc.config.js (if {"type": "module"} in package.json)
|
|
126
131
|
export default {
|
|
127
|
-
|
|
128
|
-
}
|
|
132
|
+
extends: ['@halospv3/hce.shared-config'],
|
|
133
|
+
};
|
|
129
134
|
```
|
|
130
135
|
|
|
131
136
|
```js
|
|
132
137
|
// releaserc.config.js (if {"type": "commonjs"} in package.json)
|
|
133
138
|
module.exports = {
|
|
134
|
-
|
|
135
|
-
}
|
|
139
|
+
extends: ['@halospv3/hce.shared-config'],
|
|
140
|
+
};
|
|
136
141
|
```
|
|
137
142
|
|
|
138
143
|
###### `release` key in package.json
|
|
@@ -141,47 +146,49 @@ module.exports = {
|
|
|
141
146
|
// package.json
|
|
142
147
|
// `npm install --save-dev cross-env`
|
|
143
148
|
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
"scripts": {
|
|
150
|
+
"release": "cross-env PROJECTS_TO_PUBLISH=\"./Library/Library.csproj;./Sample/Sample.csproj\" semantic-release"
|
|
151
|
+
},
|
|
152
|
+
"release": {
|
|
153
|
+
"extends": ["@halospv3/hce.shared-config/semanticReleaseConfigDotnet"]
|
|
154
|
+
}
|
|
150
155
|
}
|
|
151
156
|
```
|
|
152
157
|
|
|
153
158
|
---
|
|
154
159
|
|
|
155
|
-
|
|
160
|
+
#### Notable Plugin Properties
|
|
156
161
|
|
|
157
162
|
- [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer#options)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
163
|
+
- preset (set to `conventionalcommits`)
|
|
164
|
+
- parserOpts
|
|
165
|
+
- releaseRules
|
|
161
166
|
- [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator#options)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
167
|
+
- preset (set to `conventionalcommits`)
|
|
168
|
+
- parserOpts
|
|
169
|
+
- writerOpts
|
|
165
170
|
- [`@semantic-release/changelog`](https://github.com/semantic-release/changelog#options)
|
|
166
|
-
|
|
171
|
+
- changelogFile (default: `'CHANGELOG.md'`)
|
|
167
172
|
- [`@semantic-release/git`](https://github.com/semantic-release/git#options)
|
|
168
|
-
|
|
173
|
+
- assets (default:
|
|
174
|
+
`['README.md', 'CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json']`)
|
|
169
175
|
- `@semantic-release/exec`
|
|
170
|
-
|
|
176
|
+
- prepareCmd
|
|
171
177
|
- [`@semantic-release/github`](https://github.com/semantic-release/github#options)
|
|
172
|
-
|
|
173
|
-
|
|
178
|
+
- assets
|
|
179
|
+
- draftRelease (default: false)
|
|
174
180
|
|
|
175
181
|
### 3. Set Up CommitLint
|
|
176
182
|
|
|
177
183
|
```json
|
|
178
184
|
// package.json
|
|
179
185
|
{
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
186
|
+
"commitlint": {
|
|
187
|
+
"extends": ["@halospv3/hce.shared-config/commitlintConfig"]
|
|
188
|
+
}
|
|
183
189
|
}
|
|
184
190
|
```
|
|
191
|
+
|
|
185
192
|
or
|
|
186
193
|
|
|
187
194
|
```ts
|
|
@@ -192,6 +199,7 @@ export default commitlintConfig;
|
|
|
192
199
|
```
|
|
193
200
|
|
|
194
201
|
Then...
|
|
202
|
+
|
|
195
203
|
```sh
|
|
196
204
|
npx husky
|
|
197
205
|
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
|
|
@@ -201,21 +209,22 @@ npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
|
|
|
201
209
|
|
|
202
210
|
```xml
|
|
203
211
|
<Project>
|
|
204
|
-
|
|
212
|
+
<Import Project="$(HCESharedDir)/dotnet/HCE.Shared.targets"/>
|
|
205
213
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
214
|
+
<PropertyGroup>
|
|
215
|
+
<RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</RepoRoot>
|
|
216
|
+
<HCESharedDir Condition="'$(HCESharedDir)' == ''">$(RepoRoot)node_modules/@halospv3/hce.shared-config/</HCESharedDir>
|
|
217
|
+
<!--<GitVersion_Path Condition="'$(GitVersion_Path)' == ''">Path/To/Your/GitVersion.yml</GitVersion_Path>-->
|
|
218
|
+
</PropertyGroup>
|
|
211
219
|
</Project>
|
|
212
220
|
```
|
|
213
221
|
|
|
214
222
|
These may evaluate to the following:
|
|
215
|
-
|
|
216
|
-
|
|
|
217
|
-
|
|
218
|
-
|
|
223
|
+
|
|
224
|
+
| Property | Evaluated Value |
|
|
225
|
+
| -------------- | ------------------------------------------------------------------------ |
|
|
226
|
+
| `RepoRootDir` | `c:\Repos\HaloSPV3\HCE.Shared\` |
|
|
227
|
+
| `HCESharedDir` | `c:\Repos\HaloSPV3\HCE.Shared\node_modules\@halospv3\hce.shared-config\` |
|
|
219
228
|
|
|
220
229
|
#### CI/CD-Only Properties
|
|
221
230
|
|
|
@@ -227,15 +236,15 @@ conditional property group to the props file:
|
|
|
227
236
|
|
|
228
237
|
```xml, diff
|
|
229
238
|
<Project>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
+
<PropertyGroup>
|
|
240
|
+
...
|
|
241
|
+
</PropertyGroup>
|
|
242
|
+
|
|
243
|
+
<PropertyGroup Condition=" '$(CI)' == 'true' ">
|
|
244
|
+
<Configuration>Release</Configuration>
|
|
245
|
+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
|
246
|
+
<Deterministic>true</Deterministic>
|
|
247
|
+
</PropertyGroup>
|
|
239
248
|
</Project>
|
|
240
249
|
```
|
|
241
250
|
|
|
@@ -256,25 +265,28 @@ packages.
|
|
|
256
265
|
You can...
|
|
257
266
|
|
|
258
267
|
...define it yourself
|
|
268
|
+
|
|
259
269
|
```xml
|
|
260
270
|
<Project>
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
271
|
+
<PropertyGroup>
|
|
272
|
+
<GitVersion_Path>$(ProjectRootDir)/node_modules/@halospv3/hce.shared-config/dotnet/GitVersion.yml</GitVersion_Path>
|
|
273
|
+
</PropertyGroup>
|
|
264
274
|
</Project>
|
|
265
275
|
```
|
|
266
276
|
|
|
267
277
|
...import HCE.Shared.props
|
|
278
|
+
|
|
268
279
|
```xml
|
|
269
280
|
<Project>
|
|
270
|
-
|
|
281
|
+
<Import Project="$(HCESharedDir)/dotnet/HCE.Shared.props">
|
|
271
282
|
</Project>
|
|
272
283
|
```
|
|
273
284
|
|
|
274
285
|
...import HCE.Shared.Targets (which imports HCE.Shared.props)
|
|
286
|
+
|
|
275
287
|
```xml
|
|
276
288
|
<Project>
|
|
277
|
-
|
|
289
|
+
<Import Project="$(HCESharedDir)/dotnet/HCE.Shared.props">
|
|
278
290
|
</Project>
|
|
279
291
|
```
|
|
280
292
|
|
|
@@ -286,6 +298,7 @@ If you want to use this information in other Semantic Release steps, you'll need
|
|
|
286
298
|
`semantic-release-export-data`.
|
|
287
299
|
|
|
288
300
|
Run the following to preview the version:
|
|
301
|
+
|
|
289
302
|
```sh
|
|
290
303
|
npx semantic-release --dry-run --plugins "@semantic-release/commit-analyzer,semantic-release-export-data"
|
|
291
304
|
```
|
|
@@ -301,7 +314,7 @@ Add the following to `package.json`:
|
|
|
301
314
|
|
|
302
315
|
```json
|
|
303
316
|
{
|
|
304
|
-
|
|
317
|
+
"private": true
|
|
305
318
|
}
|
|
306
319
|
```
|
|
307
320
|
|
|
@@ -313,13 +326,13 @@ See callable workflows such as [dotnet-ci](./.github/workflows/dotnet-ci.yml)
|
|
|
313
326
|
|
|
314
327
|
```yml
|
|
315
328
|
jobs:
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
329
|
+
release:
|
|
330
|
+
steps:
|
|
331
|
+
- uses: actions/checkout@v3
|
|
332
|
+
- name: dotnet build/publish; copy release artifacts to './publish/'
|
|
333
|
+
uses: ./node_modules/@halospv3/hce.shared/dotnet/.github/workflows/dotnet-release.yml
|
|
334
|
+
with:
|
|
335
|
+
projects:
|
|
336
|
+
- src/lib/lib.csproj
|
|
337
|
+
- src/lib-sample/sample.csproj
|
|
325
338
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
on:
|
|
3
3
|
workflow_call:
|
|
4
4
|
env:
|
|
5
|
-
DOTNET_ROLL_FORWARD:
|
|
5
|
+
DOTNET_ROLL_FORWARD: 'Major'
|
|
6
6
|
|
|
7
7
|
jobs:
|
|
8
8
|
unit_test:
|
|
@@ -14,12 +14,15 @@ jobs:
|
|
|
14
14
|
|
|
15
15
|
runs-on: ${{ matrix.os }}
|
|
16
16
|
steps:
|
|
17
|
+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
|
|
18
|
+
with:
|
|
19
|
+
config: ${{ vars.PERMISSIONS_CONFIG }}
|
|
17
20
|
- uses: actions/checkout@v4
|
|
18
21
|
with:
|
|
19
22
|
fetch-depth: 0
|
|
20
23
|
- uses: actions/setup-node@v4
|
|
21
24
|
with:
|
|
22
|
-
cache:
|
|
25
|
+
cache: 'npm'
|
|
23
26
|
check-latest: true
|
|
24
27
|
node-version-file: package.json
|
|
25
28
|
- run: npm i -g npm@latest
|
|
@@ -27,6 +30,6 @@ jobs:
|
|
|
27
30
|
|
|
28
31
|
- uses: actions/setup-dotnet@v4.3.1
|
|
29
32
|
with:
|
|
30
|
-
dotnet-version:
|
|
33
|
+
dotnet-version: '8.x'
|
|
31
34
|
|
|
32
35
|
- run: dotnet test
|
|
@@ -11,7 +11,7 @@ on:
|
|
|
11
11
|
workflow_call:
|
|
12
12
|
|
|
13
13
|
env:
|
|
14
|
-
DOTNET_ROLL_FORWARD:
|
|
14
|
+
DOTNET_ROLL_FORWARD: 'Major'
|
|
15
15
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
16
16
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
|
17
17
|
DOTNET_NOLOGO: 1
|
|
@@ -19,4 +19,4 @@ env:
|
|
|
19
19
|
jobs:
|
|
20
20
|
unit_test:
|
|
21
21
|
name: Unit Test
|
|
22
|
-
uses:
|
|
22
|
+
uses: ./dotnet/.github/workflows/_unit_test.yml # <- your unit test workflow here. Example: file://./_unit_test.yml
|
|
@@ -6,16 +6,16 @@ name: dotnet-release
|
|
|
6
6
|
|
|
7
7
|
on:
|
|
8
8
|
push:
|
|
9
|
-
branches: [
|
|
9
|
+
branches: [main, develop]
|
|
10
10
|
paths-ignore:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
- '.github/**/*.*'
|
|
12
|
+
- '**/*.md'
|
|
13
|
+
- '**/*.txt'
|
|
14
14
|
|
|
15
15
|
jobs:
|
|
16
16
|
ci:
|
|
17
17
|
name: CI # run test.yml. If it fails, this job fails.
|
|
18
|
-
uses:
|
|
18
|
+
uses: ./dotnet/.github/workflows/ci.yml # <- your CI workflow here. Example: 'file://./ci.yml'
|
|
19
19
|
release:
|
|
20
20
|
needs: [ci] # start 'release' if 'ci' completes successfully
|
|
21
21
|
runs-on: ubuntu-latest
|
|
@@ -24,27 +24,30 @@ jobs:
|
|
|
24
24
|
issues: write
|
|
25
25
|
pull-requests: write
|
|
26
26
|
steps:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
|
|
28
|
+
with:
|
|
29
|
+
config: ${{ vars.PERMISSIONS_CONFIG }}
|
|
30
|
+
################
|
|
31
|
+
# SETUP
|
|
32
|
+
################
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
with:
|
|
35
|
+
fetch-depth: 0 # Required by GitVersion, Semantic Release
|
|
36
|
+
submodules: 'recursive' # submodule fetch depth unknown
|
|
37
|
+
- uses: actions/setup-dotnet@v4
|
|
38
|
+
- uses: actions/setup-node@v4
|
|
39
|
+
- run: npm install -g npm@latest
|
|
40
|
+
- run: npm ci # Required by Semantic Release
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
################
|
|
43
|
+
# RELEASE
|
|
44
|
+
# @semantic-release/exec should be configured to execute
|
|
45
|
+
# `dotnet publish`, `dotnet pack`, and `dotnet nuget push`
|
|
46
|
+
# You can use this package's semanticReleaseConfigDotnet exports to do so.
|
|
47
|
+
################
|
|
48
|
+
# https://github.com/semantic-release/semantic-release
|
|
49
|
+
- name: Semantic Release
|
|
50
|
+
run: npx semantic-release
|
|
51
|
+
env:
|
|
52
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
53
|
+
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
|
|
@@ -9,15 +9,20 @@ jobs:
|
|
|
9
9
|
build:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
|
|
13
|
+
with:
|
|
14
|
+
config: ${{ vars.PERMISSIONS_CONFIG }}
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
submodules: 'recursive'
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
- uses: actions/setup-dotnet@v4
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
- run:
|
|
22
|
+
dotnet build src/SPV3.csproj -c Release
|
|
23
|
+
-p:ContinuousIntegrationBuild=true
|
|
24
|
+
# ContinuousIntegrationBuild comes from dotnet/sourcelink.
|
|
25
|
+
# Make sure Deterministic is also true!
|
|
26
|
+
# If you use this package's dotnet props/targets files, you're good to go!
|
|
27
|
+
#
|
|
28
|
+
# Alternatively, add a PropertyGroup with the condition " '$(CI)' != '' "
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<h1 align="center">ExecNupkgDeterministicator.target</h1>
|
|
2
|
+
|
|
3
|
+
This target runs after "Pack" and utilizes `kuinox.nupkgdeterministicator` to make the nupkg (and snupkg!) deterministic. However, this target does not include `kuinox.nupkgdeterministicator`. As such, an Error task will be executed if the dotnet tool `kuinox.nupkgdeterministicator` is not installed locally nor globally. Cake and NUKE are not supported by this MSBuild Target.
|
|
4
|
+
|
|
5
|
+
Learn more about Kuinox's NupkgDeterministicator\
|
|
6
|
+
[GitHub](https://github.com/Kuinox/NupkgDeterministicator) | [Nuget](https://www.nuget.org/packages/Kuinox.NupkgDeterministicator)
|
|
7
|
+
|
|
8
|
+
## Install `kuinox.nupkgdeterministicator`
|
|
9
|
+
|
|
10
|
+
### .NET CLI (Global)
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
dotnet tool install -g NupkgDeterministicator
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### .NET CLI (Local)
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
dotnet tool install -g NupkgDeterministicator
|
|
20
|
+
```
|