Missing /index.json restored

This commit is contained in:
Alex Mullans 2019-10-03 18:00:43 -07:00
parent 70528ac007
commit 2f00ce2a3e
4 changed files with 38 additions and 17 deletions

View File

@ -62,6 +62,27 @@ steps:
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
The scripts and documentation in this project are released under the [MIT License](LICENSE)

View File

@ -4,7 +4,7 @@ exports[`authutil tests Existing config not in repo root, sets up a partial NuGe
"<?xml version=\\"1.0\\"?>
<configuration>
<config>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</config>
<packageSourceCredentials>
<GPR>
@ -34,7 +34,7 @@ exports[`authutil tests Existing config w/ GPR source and NuGet.org, sets up a p
"<?xml version=\\"1.0\\"?>
<configuration>
<config>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</config>
<packageSourceCredentials>
<GPR>
@ -49,10 +49,10 @@ exports[`authutil tests Existing config w/ no GPR sources, sets up a full NuGet.
"<?xml version=\\"1.0\\"?>
<configuration>
<config>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</config>
<packageSources>
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</packageSources>
<packageSourceCredentials>
<Source>
@ -67,10 +67,10 @@ exports[`authutil tests Existing config w/ no sources, sets up a full NuGet.conf
"<?xml version=\\"1.0\\"?>
<configuration>
<config>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</config>
<packageSources>
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</packageSources>
<packageSourceCredentials>
<Source>
@ -100,7 +100,7 @@ exports[`authutil tests Existing config w/ only GPR source, sets up a partial Nu
"<?xml version=\\"1.0\\"?>
<configuration>
<config>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</config>
<packageSourceCredentials>
<GPR>
@ -115,7 +115,7 @@ exports[`authutil tests Existing config w/ two GPR sources, sets up a partial Nu
"<?xml version=\\"1.0\\"?>
<configuration>
<config>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</config>
<packageSourceCredentials>
<GPR-GitHub>
@ -134,10 +134,10 @@ exports[`authutil tests No existing config, sets up a full NuGet.config with URL
"<?xml version=\\"1.0\\"?>
<configuration>
<config>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/otherorg\\"/>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/otherorg/index.json\\"/>
</config>
<packageSources>
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/otherorg\\"/>
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/otherorg/index.json\\"/>
</packageSources>
<packageSourceCredentials>
<Source>
@ -170,10 +170,10 @@ exports[`authutil tests No existing config, sets up a full NuGet.config with URL
"<?xml version=\\"1.0\\"?>
<configuration>
<config>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"defaultPushSource\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</config>
<packageSources>
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName\\"/>
<add key=\\"Source\\" value=\\"https://nuget.pkg.github.com/OwnerName/index.json\\"/>
</packageSources>
<packageSourceCredentials>
<Source>

View File

@ -29,7 +29,7 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
owner = github.context.repo.owner;
}
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 == '') {
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();
sourceKeys.push(keystring);
}
xml = xml
.ele('packageSourceCredentials');
xml = xml.ele('packageSourceCredentials');
sourceKeys.forEach(key => {
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.");
}
xml = xml.ele(key)
xml = xml
.ele(key)
.ele('add', { key: 'Username', value: owner })
.up()
.ele('add', {

View File

@ -41,7 +41,7 @@ function writeFeedToFile(
owner = github.context.repo.owner;
}
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 == '') {