Missing /index.json restored
This commit is contained in:
parent
70528ac007
commit
2f00ce2a3e
21
README.md
21
README.md
|
@ -62,6 +62,27 @@ steps:
|
||||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Authentication to Azure Artifacts:
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- uses: actions/setup-dotnet@v1
|
||||||
|
with:
|
||||||
|
dotnet-version: '2.2.103' # SDK Version to use.
|
||||||
|
source-url: https://pkgs.dev.azure.com/<your-organization>/_packaging/<your-feed-name>/nuget/v3/index.json
|
||||||
|
env:
|
||||||
|
NUGET_AUTH_TOKEN: ${{secrets.AZURE_DEVOPS_PAT}} # Note, create a secret with this name in Settings
|
||||||
|
- run: dotnet build <my project>
|
||||||
|
- name: Create the package
|
||||||
|
run: dotnet pack --configuration Release <my project>
|
||||||
|
env:
|
||||||
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||||
|
- name: Publish the package
|
||||||
|
run: dotnet nuget push <my project>/bin/Release/*.nupkg
|
||||||
|
env:
|
||||||
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||||
|
```
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||||
|
|
|
@ -4,7 +4,7 @@ exports[`authutil tests Existing config not in repo root, sets up a partial NuGe
|
||||||
"<?xml version=\\"1.0\\"?>
|
"<?xml version=\\"1.0\\"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<config>
|
<config>
|
||||||
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</config>
|
</config>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<GPR>
|
<GPR>
|
||||||
|
@ -34,7 +34,7 @@ exports[`authutil tests Existing config w/ GPR source and NuGet.org, sets up a p
|
||||||
"<?xml version=\\"1.0\\"?>
|
"<?xml version=\\"1.0\\"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<config>
|
<config>
|
||||||
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</config>
|
</config>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<GPR>
|
<GPR>
|
||||||
|
@ -49,10 +49,10 @@ exports[`authutil tests Existing config w/ no GPR sources, sets up a full NuGet.
|
||||||
"<?xml version=\\"1.0\\"?>
|
"<?xml version=\\"1.0\\"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<config>
|
<config>
|
||||||
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</config>
|
</config>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<Source>
|
<Source>
|
||||||
|
@ -67,10 +67,10 @@ exports[`authutil tests Existing config w/ no sources, sets up a full NuGet.conf
|
||||||
"<?xml version=\\"1.0\\"?>
|
"<?xml version=\\"1.0\\"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<config>
|
<config>
|
||||||
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</config>
|
</config>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<Source>
|
<Source>
|
||||||
|
@ -100,7 +100,7 @@ exports[`authutil tests Existing config w/ only GPR source, sets up a partial Nu
|
||||||
"<?xml version=\\"1.0\\"?>
|
"<?xml version=\\"1.0\\"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<config>
|
<config>
|
||||||
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</config>
|
</config>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<GPR>
|
<GPR>
|
||||||
|
@ -115,7 +115,7 @@ exports[`authutil tests Existing config w/ two GPR sources, sets up a partial Nu
|
||||||
"<?xml version=\\"1.0\\"?>
|
"<?xml version=\\"1.0\\"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<config>
|
<config>
|
||||||
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</config>
|
</config>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<GPR-GitHub>
|
<GPR-GitHub>
|
||||||
|
@ -134,10 +134,10 @@ exports[`authutil tests No existing config, sets up a full NuGet.config with URL
|
||||||
"<?xml version=\\"1.0\\"?>
|
"<?xml version=\\"1.0\\"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<config>
|
<config>
|
||||||
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/otherorg\\"/>
|
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/otherorg/index.json\\"/>
|
||||||
</config>
|
</config>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/otherorg\\"/>
|
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/otherorg/index.json\\"/>
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<Source>
|
<Source>
|
||||||
|
@ -170,10 +170,10 @@ exports[`authutil tests No existing config, sets up a full NuGet.config with URL
|
||||||
"<?xml version=\\"1.0\\"?>
|
"<?xml version=\\"1.0\\"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<config>
|
<config>
|
||||||
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</config>
|
</config>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
|
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<Source>
|
<Source>
|
||||||
|
|
|
@ -29,7 +29,7 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
|
||||||
owner = github.context.repo.owner;
|
owner = github.context.repo.owner;
|
||||||
}
|
}
|
||||||
if (feedUrl.indexOf('nuget.pkg.github.com') > -1) {
|
if (feedUrl.indexOf('nuget.pkg.github.com') > -1) {
|
||||||
sourceUrl = 'https://nuget.pkg.github.com/' + owner;
|
sourceUrl = 'https://nuget.pkg.github.com/' + owner + '/index.json';
|
||||||
}
|
}
|
||||||
if (!process.env.NUGET_AUTH_TOKEN || process.env.NUGET_AUTH_TOKEN == '') {
|
if (!process.env.NUGET_AUTH_TOKEN || process.env.NUGET_AUTH_TOKEN == '') {
|
||||||
throw new Error('The NUGET_AUTH_TOKEN environment variable was not provided. In this step, add the following: \r\nenv:\r\n NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}');
|
throw new Error('The NUGET_AUTH_TOKEN environment variable was not provided. In this step, add the following: \r\nenv:\r\n NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}');
|
||||||
|
@ -85,13 +85,13 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
|
||||||
.up();
|
.up();
|
||||||
sourceKeys.push(keystring);
|
sourceKeys.push(keystring);
|
||||||
}
|
}
|
||||||
xml = xml
|
xml = xml.ele('packageSourceCredentials');
|
||||||
.ele('packageSourceCredentials');
|
|
||||||
sourceKeys.forEach(key => {
|
sourceKeys.forEach(key => {
|
||||||
if (key.indexOf(' ') > -1) {
|
if (key.indexOf(' ') > -1) {
|
||||||
throw new Error("This action currently can't handle source names with spaces. Remove the space from your repo's NuGet.config and try again.");
|
throw new Error("This action currently can't handle source names with spaces. Remove the space from your repo's NuGet.config and try again.");
|
||||||
}
|
}
|
||||||
xml = xml.ele(key)
|
xml = xml
|
||||||
|
.ele(key)
|
||||||
.ele('add', { key: 'Username', value: owner })
|
.ele('add', { key: 'Username', value: owner })
|
||||||
.up()
|
.up()
|
||||||
.ele('add', {
|
.ele('add', {
|
||||||
|
|
|
@ -41,7 +41,7 @@ function writeFeedToFile(
|
||||||
owner = github.context.repo.owner;
|
owner = github.context.repo.owner;
|
||||||
}
|
}
|
||||||
if (feedUrl.indexOf('nuget.pkg.github.com') > -1) {
|
if (feedUrl.indexOf('nuget.pkg.github.com') > -1) {
|
||||||
sourceUrl = 'https://nuget.pkg.github.com/' + owner;
|
sourceUrl = 'https://nuget.pkg.github.com/' + owner + '/index.json';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!process.env.NUGET_AUTH_TOKEN || process.env.NUGET_AUTH_TOKEN == '') {
|
if (!process.env.NUGET_AUTH_TOKEN || process.env.NUGET_AUTH_TOKEN == '') {
|
||||||
|
|
Loading…
Reference in New Issue