Skip to content

Commit 2e6219b

Browse files
authored
Exclude NuGet publishing and replace GH release (#10)
* comment unnecessary steps, replace create release steps * remove accidental if
1 parent 6239db1 commit 2e6219b

File tree

1 file changed

+36
-55
lines changed

1 file changed

+36
-55
lines changed

.github/workflows/ci-cd.yml

Lines changed: 36 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ jobs:
7070
7171
$projectsArray | ForEach-Object {
7272
dotnet build $PSItem `
73-
-c Release `
74-
-o $env:ARTIFACTS_FOLDER `
75-
/p:Version=$projectNewVersion
73+
-c Release # `
74+
# -o $env:ARTIFACTS_FOLDER `
75+
# /p:Version=$projectNewVersion
7676
}
7777
7878
# Move NuGet packages to separate folder for pipeline convenience
79-
New-Item Artifacts/NuGet -ItemType Directory
80-
Get-ChildItem Artifacts/*.nupkg | Move-Item -Destination "Artifacts/NuGet"
79+
# New-Item Artifacts/NuGet -ItemType Directory
80+
# Get-ChildItem Artifacts/*.nupkg | Move-Item -Destination "Artifacts/NuGet"
8181
8282
- name: Run unit tests
8383
id: run_unit_tests
@@ -94,68 +94,49 @@ jobs:
9494
-c Release
9595
}
9696
97-
- if: steps.tag_generator.outputs.new_version != ''
98-
name: Upload NuGet packages as artifacts
99-
id: ul_packages_artifact
100-
uses: actions/upload-artifact@v1
101-
with:
102-
name: NuGet packages
103-
path: Artifacts/NuGet/
97+
# - if: steps.tag_generator.outputs.new_version != ''
98+
# name: Upload NuGet packages as artifacts
99+
# id: ul_packages_artifact
100+
# uses: actions/upload-artifact@v1
101+
# with:
102+
# name: NuGet packages
103+
# path: Artifacts/NuGet/
104104

105105
cd:
106106
if: needs.ci.outputs.is_default_branch == 'true' && needs.ci.outputs.latest_version != ''
107107
name: Continuous Deployment
108108
needs: ci
109109
runs-on: ubuntu-latest
110110
steps:
111-
- name: Download and extract NuGet packages
112-
id: dl_packages_artifact
113-
uses: actions/download-artifact@v2
114-
with:
115-
name: NuGet packages
116-
path: NuGet/
117-
118-
- name: Push NuGet packages to NuGet.org
119-
id: push_nuget_packages
120-
continue-on-error: true
121-
shell: pwsh
122-
run: |
123-
Get-ChildItem NuGet/*.nupkg | ForEach-Object {
124-
nuget push $PSItem `
125-
-ApiKey $env:NUGET_API_KEY `
126-
-Source https://api.nuget.org/v3/index.json
127-
}
128-
env:
129-
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
111+
# - name: Download and extract NuGet packages
112+
# id: dl_packages_artifact
113+
# uses: actions/download-artifact@v2
114+
# with:
115+
# name: NuGet packages
116+
# path: NuGet/
117+
118+
# - name: Push NuGet packages to NuGet.org
119+
# id: push_nuget_packages
120+
# continue-on-error: true
121+
# shell: pwsh
122+
# run: |
123+
# Get-ChildItem NuGet/*.nupkg | ForEach-Object {
124+
# nuget push $PSItem `
125+
# -ApiKey $env:NUGET_API_KEY `
126+
# -Source https://api.nuget.org/v3/index.json
127+
# }
128+
# env:
129+
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
130130

131131
- name: Create and publish release
132132
id: create_release
133-
uses: actions/create-release@v1
133+
uses: softprops/action-gh-release@v1
134134
with:
135+
name: OpenApi v${{ needs.ci.outputs.latest_version }}
135136
tag_name: v${{ needs.ci.outputs.latest_version }}
136-
release_name: OpenApi v${{ needs.ci.outputs.latest_version }}
137-
env:
138-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139-
140-
- name: Upload OpenAPI package as release asset
141-
id: upload_openapi_pckg
142-
uses: actions/upload-release-asset@v1
143-
with:
144-
upload_url: ${{ steps.create_release.outputs.upload_url }}
145-
asset_path: NuGet/Microsoft.OpenApi.${{ needs.ci.outputs.latest_version }}.nupkg
146-
asset_name: Microsoft.OpenApi.${{ needs.ci.outputs.latest_version }}.nupkg
147-
asset_content_type: application/zip
148-
env:
149-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150-
151-
- name: Upload OpenAPI.Readers package as release asset
152-
id: upload_openapi_readers_pckg
153-
uses: actions/upload-release-asset@v1
154-
with:
155-
upload_url: ${{ steps.create_release.outputs.upload_url }}
156-
asset_path: NuGet/Microsoft.OpenApi.Readers.${{ needs.ci.outputs.latest_version }}.nupkg
157-
asset_name: Microsoft.OpenApi.Readers.${{ needs.ci.outputs.latest_version }}.nupkg
158-
asset_content_type: application/zip
137+
# files: |
138+
# NuGet/Microsoft.OpenApi.${{ needs.ci.outputs.latest_version }}.nupkg
139+
# NuGet/Microsoft.OpenApi.Readers.${{ needs.ci.outputs.latest_version }}.nupkg
159140
env:
160141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161142

0 commit comments

Comments
 (0)