Skip to content

Commit

Permalink
Remove special case for gpr url
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Eisinger committed Nov 25, 2019
1 parent ff633a5 commit 167e5cb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 68 deletions.
27 changes: 6 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,46 +41,31 @@ jobs:
- run: dotnet build <my project>
```
Authentication to GPR:
Authentication for nuget feeds:
```yaml
steps:
- uses: actions/checkout@master
# Authenticates packages to push to GPR
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.2.103' # SDK Version to use.
source-url: https://nuget.pkg.github.com
source-url: https://nuget.pkg.github.com/<owner>/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- 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
- name: Publish the package to GPR
run: dotnet nuget push <my project>/bin/Release/*.nupkg
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
```

Authentication to Azure Artifacts:
```yaml
steps:
- uses: actions/checkout@master
# Authticates packages to push to Azure Artifacts
- 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
- name: Publish the package to Azure Artifacts
run: dotnet nuget push <my project>/bin/Release/*.nupkg
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
```
# License
Expand Down
3 changes: 0 additions & 3 deletions lib/authutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
if (!owner) {
owner = github.context.repo.owner;
}
if (feedUrl.indexOf('nuget.pkg.github.com') > -1) {
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}}');
}
Expand Down
57 changes: 17 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/authutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ function writeFeedToFile(
if (!owner) {
owner = github.context.repo.owner;
}
if (feedUrl.indexOf('nuget.pkg.github.com') > -1) {
sourceUrl = 'https://nuget.pkg.github.com/' + owner + '/index.json';
}

if (!process.env.NUGET_AUTH_TOKEN || process.env.NUGET_AUTH_TOKEN == '') {
throw new Error(
Expand Down
1 change: 0 additions & 1 deletion src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {chmodSync} from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as semver from 'semver';
import * as util from 'util';

const IS_WINDOWS = process.platform === 'win32';

Expand Down

0 comments on commit 167e5cb

Please sign in to comment.