Skip to content

Commit db89e96

Browse files
committed
Use GitHub Actions for deployments
1 parent 5310072 commit db89e96

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

.github/workflows/build.yml

+34
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,37 @@ jobs:
5252
with:
5353
name: ${{matrix.os}}
5454
path: './Artefacts'
55+
56+
push-github-packages:
57+
name: 'Push GitHub Packages'
58+
needs: build
59+
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
60+
runs-on: windows-latest
61+
steps:
62+
- name: 'Download Artefact'
63+
uses: actions/download-artifact@v1
64+
with:
65+
name: 'windows-latest'
66+
- name: 'Dotnet NuGet Add Source'
67+
run: dotnet nuget add source https://nuget.pkg.github.com/RehanSaeed --name GitHub --username RehanSaeed --password ${{secrets.GITHUB_TOKEN}}
68+
shell: pwsh
69+
- name: 'Dotnet NuGet Push'
70+
run: dotnet nuget push .\windows-latest\*.nupkg --source GitHub --skip-duplicate
71+
shell: pwsh
72+
73+
push-nuget:
74+
name: 'Push NuGet Packages'
75+
needs: build
76+
if: github.event_name == 'release'
77+
runs-on: windows-latest
78+
steps:
79+
- name: 'Download Artefact'
80+
uses: actions/download-artifact@v1
81+
with:
82+
name: 'windows-latest'
83+
- name: 'Dotnet NuGet Push'
84+
run: |
85+
Get-ChildItem .\windows-latest -Filter *.nupkg |
86+
Where-Object { !$_.Name.Contains('preview') } |
87+
ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} }
88+
shell: pwsh

azure-pipelines.yml

-34
Original file line numberDiff line numberDiff line change
@@ -85,37 +85,3 @@ stages:
8585
- pwsh: nuget push $(Agent.BuildDirectory)\Windows\*.nupkg -Source https://pkgs.dev.azure.com/schema-net/_packaging/schema-net/nuget/v3/index.json -ApiKey AzureArtifacts -SkipDuplicate
8686
displayName: 'NuGet Push'
8787
failOnStderr: true
88-
- deployment: GitHub
89-
condition: ne(variables['Build.Reason'], 'PullRequest')
90-
pool:
91-
vmImage: windows-latest
92-
environment: 'GitHub'
93-
strategy:
94-
runOnce:
95-
deploy:
96-
steps:
97-
- task: NuGetToolInstaller@1
98-
displayName: 'NuGet Install'
99-
- pwsh: nuget source Add -Name GitHub -Source https://nuget.pkg.github.com/RehanSaeed/index.json -UserName $(GitHubUserName) -Password $(GitHubPersonalAccessToken)
100-
displayName: 'NuGet Add Source'
101-
failOnStderr: true
102-
- pwsh: nuget push $(Agent.BuildDirectory)\Windows\*.nupkg -Source GitHub -SkipDuplicate
103-
displayName: 'NuGet Push'
104-
failOnStderr: true
105-
- deployment: NuGet
106-
condition: and(ne(variables['Build.Reason'], 'PullRequest'), startsWith(variables['Build.sourceBranch'], 'refs/tags/'))
107-
pool:
108-
vmImage: windows-latest
109-
environment: 'NuGet'
110-
strategy:
111-
runOnce:
112-
deploy:
113-
steps:
114-
- task: NuGetToolInstaller@1
115-
displayName: 'Install NuGet'
116-
- pwsh: |
117-
Get-ChildItem $(Agent.BuildDirectory)\Windows -Filter *.nupkg |
118-
Where-Object { !$_.Name.Contains('preview') } |
119-
ForEach-Object { nuget push $_ -Source https://api.nuget.org/v3/index.json -ApiKey $(NuGetApiKey) -SkipDuplicate }
120-
displayName: 'NuGet Push'
121-
failOnStderr: true

0 commit comments

Comments
 (0)