Skip to content

Commit f6ea996

Browse files
committed
Use GitHub Actions for NuGet packages
1 parent aefd7fb commit f6ea996

File tree

2 files changed

+33
-36
lines changed

2 files changed

+33
-36
lines changed

.appveyor.yml

+1-29
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,4 @@ build_script:
2323

2424
test: false
2525
artifacts:
26-
- path: '**\$(BUILD_ARTIFACT_PATH)\*'
27-
28-
deploy:
29-
- provider: NuGet
30-
artifact: /.*nupkg/
31-
api_key:
32-
secure: QNfyCsBxCLb4iGmaRd2ep7yYY3RMJKw54B7p+ZcFDo5pb8KnWM0ULl4ml2u38s/w
33-
on:
34-
APPVEYOR_REPO_TAG: true
35-
36-
- provider: NuGet
37-
server: https://nuget.pkg.github.com/TurnerSoftware/index.json
38-
artifact: /.*\.nupkg/
39-
skip_symbols: true
40-
username: TurnerSoftware
41-
api_key:
42-
secure: XnTMWCpraeRGwQ/HGCQIneJDAIIsF7MypVnaShycKC95P3+IA0MF+qXV16c8/5jg
43-
on:
44-
APPVEYOR_REPO_TAG: true
45-
46-
- provider: GitHub
47-
artifact: /.*nupkg/
48-
draft: true
49-
release: $(APPVEYOR_REPO_TAG_NAME)
50-
description: 'TODO'
51-
auth_token:
52-
secure: 8WGv8noklaCJAQEBpcs+VShk/Hql5zbyx0VPhMvzUw0RcG7rAd2KxKIh4gazXlBi
53-
on:
54-
APPVEYOR_REPO_TAG: true
26+
- path: '**\$(BUILD_ARTIFACT_PATH)\*'

.github/workflows/build.yml

+32-7
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,39 @@ jobs:
6868
with:
6969
name: coverage-report
7070
path: Cobertura.xml
71-
72-
release:
73-
name: Release
71+
72+
push-to-github-packages:
73+
name: 'Push GitHub Packages'
74+
needs: build
75+
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
76+
environment:
77+
name: 'GitHub Packages'
78+
url: https://github.com/TurnerSoftware/BuildVersioning/packages
79+
permissions:
80+
packages: write
7481
runs-on: ubuntu-latest
82+
steps:
83+
- name: 'Download build'
84+
uses: actions/download-artifact@v2
85+
with:
86+
name: 'ubuntu-latest'
87+
- name: 'Add NuGet source'
88+
run: dotnet nuget add source https://nuget.pkg.github.com/TurnerSoftware/index.json --name GitHub --username Turnerj --password ${{secrets.GITHUB_TOKEN}} --store-password-in-clear-text
89+
- name: 'Upload NuGet package'
90+
run: dotnet nuget push *.nupkg --api-key ${{secrets.GH_PACKAGE_REGISTRY_API_KEY}} --source GitHub --skip-duplicate --no-symbols true
91+
92+
push-to-nuget:
93+
name: 'Push NuGet Packages'
7594
needs: build
7695
if: github.event_name == 'release'
96+
environment:
97+
name: 'NuGet'
98+
url: https://www.nuget.org/packages/TurnerSoftware.BuildVersioning
99+
runs-on: ubuntu-latest
77100
steps:
78-
- name: Download build
79-
uses: actions/download-artifact@v2
80-
- run: ls /ubuntu-latest
81-
# TODO: Upload to NuGet & GitHub Packages
101+
- name: 'Download build'
102+
uses: actions/download-artifact@v2
103+
with:
104+
name: 'ubuntu-latest'
105+
- name: 'Upload NuGet package and symbols'
106+
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}}

0 commit comments

Comments
 (0)