Skip to content

Commit cd29e90

Browse files
author
Petr Sramek
committed
uuu
1 parent 4891ac8 commit cd29e90

File tree

1 file changed

+267
-0
lines changed

1 file changed

+267
-0
lines changed
Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
name: Preview release with .NET CLI
2+
3+
on:
4+
release:
5+
types: [published]
6+
branches:
7+
- 'preview/**'
8+
9+
permissions:
10+
actions: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: preview-${{ github.head_ref || github.ref }}
16+
cancel-in-progress: false
17+
18+
env:
19+
dotnet-sdk-version: '9.x'
20+
build-configuration: 'Release'
21+
build-platform: 'Any CPU'
22+
git-version: '6.0.x'
23+
test-result-directory: 'test-results'
24+
25+
jobs:
26+
log:
27+
name: Versioning with GitVersion
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: 'Checkout ${{ github.head_ref || github.ref }}'
32+
uses: actions/checkout@v4
33+
- run: 'echo github: ${{ toJSON(github) }}'
34+
- run: 'echo env: ${{ toJSON(env) }}'
35+
36+
# jobs:
37+
# versioning:
38+
# name: Versioning with GitVersion
39+
# runs-on: ubuntu-latest
40+
# outputs:
41+
# ASSEMBLY_VERSION: ${{ steps.gitversion.outputs.assemblySemVer }}.${{ github.run_number }}
42+
# ASSEMBLY_INFORMATIONAL_VERSION: ${{ steps.gitversion.outputs.assemblySemVer }}.${{ github.run_number }}+${{ steps.gitversion.outputs.sha }}
43+
# FILE_VERSION: ${{ steps.gitversion.outputs.assemblySemVer }}.${{ github.run_number }}
44+
# PACKAGE_VERSION: ${{ fromJSON(format('[ "{0}{1}", "{0}" ]', steps.gitversion.outputs.assemblySemVer, steps.gitversion.outputs.preReleaseLabelWithDash))[fromJSON(env.is-release)] }}
45+
46+
# steps:
47+
# - name: 'Checkout ${{ github.head_ref || github.ref }}'
48+
# uses: actions/checkout@v4
49+
# with:
50+
# fetch-depth: 0
51+
# - name: Install GitVersion ${{ env.git-version }}
52+
# uses: gittools/actions/gitversion/setup@v3.1.11
53+
# with:
54+
# versionSpec: ${{ env.git-version }}
55+
# preferLatestVersion: true
56+
# - name: Determine version with GitVersion ${{ env.git-version }}
57+
# id: gitversion
58+
# uses: gittools/actions/gitversion/execute@v3.1.11
59+
# with:
60+
# useConfigFile: true
61+
# configFilePath: ./.gitversion/version.yml
62+
63+
# build:
64+
# name: Build with .NET
65+
# needs: [versioning]
66+
# runs-on: ubuntu-latest
67+
# env:
68+
# ASSEMBLY_VERSION: ${{ needs.versioning.outputs.ASSEMBLY_VERSION }}
69+
# ASSEMBLY_INFORMATIONAL_VERSION: ${{ needs.versioning.outputs.ASSEMBLY_INFORMATIONAL_VERSION }}
70+
# FILE_VERSION: ${{ needs.versioning.outputs.FILE_VERSION }}
71+
# steps:
72+
# - name: 'Checkout ${{ github.head_ref || github.ref }}'
73+
# uses: actions/checkout@v4
74+
75+
# - uses: ./.github/actions/build
76+
# with:
77+
# assembly-version: ${{ env.ASSEMBLY_VERSION }}
78+
# assembly-informational-version: ${{ env.ASSEMBLY_INFORMATIONAL_VERSION }}
79+
# assembly-file-version: ${{ env.FILE_VERSION }}
80+
# treat-warnins-as-error: ${{ env.is-release }}
81+
# build-glob-pattern: ${{ vars.SRC_DEFAULT_GLOB_PATTERN }}
82+
83+
# test:
84+
# name: Test with .NET
85+
# needs: [build]
86+
# runs-on: ubuntu-latest
87+
# steps:
88+
# - name: 'Checkout ${{ github.head_ref || github.ref }}'
89+
# uses: actions/checkout@v4
90+
91+
# - name: 'Setup .NET'
92+
# uses: actions/setup-dotnet@v4
93+
# with:
94+
# dotnet-version: ${{ env.dotnet-sdk-version }}
95+
96+
# - uses: ./.github/actions/test
97+
# with:
98+
# test-project-glob-pattern: ${{ vars.TEST_DEFAULT_GLOB_PATTERN }}
99+
# test-results-directory: '${{ runner.temp }}/test-results/'
100+
# code-coverage-settings-file: '${{ github.workspace}}/code-coverage-settings.xml'
101+
102+
# - uses: ./.github/actions/test-report
103+
# id: test-report
104+
# with:
105+
# test-result-folder: '${{ runner.temp }}/test-results/'
106+
# - name: Write test report summary
107+
# run: cat ${{ steps.test-report.outputs.test-report-file }} >> $GITHUB_STEP_SUMMARY
108+
109+
# - uses: ./.github/actions/code-coverage
110+
# id: code-coverage-report
111+
# with:
112+
# test-result-folder: '${{ runner.temp }}/test-results/'
113+
# - name: Write code coverage report summary
114+
# run: cat ${{ steps.code-coverage-report.outputs.code-coverage-report-file }} >> $GITHUB_STEP_SUMMARY
115+
116+
# pack:
117+
# name: Pack with .NET
118+
# needs: [build, versioning]
119+
# runs-on: ubuntu-latest
120+
# env:
121+
# ASSEMBLY_VERSION: ${{ needs.versioning.outputs.ASSEMBLY_VERSION }}
122+
# ASSEMBLY_INFORMATIONAL_VERSION: ${{ needs.versioning.outputs.ASSEMBLY_INFORMATIONAL_VERSION }}
123+
# FILE_VERSION: ${{ needs.versioning.outputs.FILE_VERSION }}
124+
# PACKAGE_VERSION: ${{ needs.versioning.outputs.PACKAGE_VERSION }}
125+
# steps:
126+
# - name: 'Checkout ${{ github.head_ref || github.ref }}'
127+
# uses: actions/checkout@v4
128+
# - name: Setup .NET
129+
# uses: actions/setup-dotnet@v4
130+
# with:
131+
# dotnet-version: ${{ env.dotnet-sdk-version }}
132+
# - name: Download Build
133+
# uses: actions/download-artifact@v4
134+
# with:
135+
# name: build
136+
# - name: Pack with .NET
137+
# run: |
138+
# dotnet pack ${{ vars.SRC_DEFAULT_GLOB_PATTERN }} --configuration ${{ env.build-configuration }} /p:Platform="${{ env.build-platform }}" /p:PackageVersion=${{ env.PACKAGE_VERSION }} /p:Version=${{ env.ASSEMBLY_VERSION }} /p:AssemblyInformationalVersion=${{ env.ASSEMBLY_INFORMATIONAL_VERSION }} /p:FileVersion=${{ env.FILE_VERSION }} --output ${{ runner.temp }}/packages/
139+
# - name: Upload Package
140+
# uses: actions/upload-artifact@v4
141+
# with:
142+
# name: package
143+
# path: |
144+
# ${{ runner.temp }}/packages/**/*.nupkg
145+
# ${{ runner.temp }}/packages/**/*.snupkg
146+
147+
# # benchmark:
148+
# # if: ${{ github.env.is_release || vars.BENCHMARKDOTNET_RUN_OVERRIDE == 'true' }}
149+
# # name: Benchmark with .NET CLI on ${{ matrix.os }}
150+
# # needs: [build]
151+
# # strategy:
152+
# # matrix:
153+
# # os: [ubuntu-latest, windows-latest, macos-latest]
154+
# # runs-on: ${{ matrix.os }}
155+
# # steps:
156+
# # - name: 'Checkout ${{ github.head_ref || github.ref }}'
157+
# # uses: actions/checkout@v4
158+
# # - name: Install .NET SDK
159+
# # uses: actions/setup-dotnet@v4
160+
# # with:
161+
# # dotnet-version: |
162+
# # 6.x
163+
# # 8.x
164+
# # 9.x
165+
# # - name: Download Build
166+
# # uses: actions/download-artifact@v4
167+
# # with:
168+
# # name: build
169+
# # - name: Benchmark
170+
# # working-directory: ${{ vars.BENCHMARKDOTNET_WORKING_DIRECTORY }}
171+
# # run: dotnet run --configuration ${{ env.build-configuration }} /p:Platform=${{ env.build-platform }} --framework ${{ vars.DEFAULT_BUILD_FRAMEWORK }} --runtimes ${{ vars.BENCHMARKDOTNET_RUNTIMES }} --filter ${{ vars.BENCHMARKDOTNET_FILTER }} --exporters GitHub --memory --artifacts ${{ runner.temp }}/benchmarks/ --join
172+
# # - name: Upload Benchmark Results
173+
# # uses: actions/upload-artifact@v4
174+
# # with:
175+
# # name: benchmark-${{ matrix.os }}
176+
# # path: |
177+
# # ${{ runner.temp }}/benchmarks/**/*-report-github.md
178+
# # - name: Write Benchmark Summary
179+
# # shell: bash
180+
# # run: cat **/*-report-github.md > $GITHUB_STEP_SUMMARY
181+
# # working-directory: ${{ runner.temp }}/benchmarks/
182+
183+
# # publish-docs:
184+
# # if: ${{ github.env.is_release && !github.env.is_preview }}
185+
# # name: Docs with docfx
186+
# # needs: [benchmark, test]
187+
# # environment:
188+
# # name: github-pages
189+
# # url: ${{ steps.deployment.outputs.page_url }}
190+
# # runs-on: ubuntu-latest
191+
# # steps:
192+
# # - name: 'Checkout ${{ github.head_ref || github.ref }}'
193+
# # uses: actions/checkout@v4
194+
# # - name: Dotnet Setup
195+
# # uses: actions/setup-dotnet@v4
196+
# # with:
197+
# # dotnet-version: ${{ env.dotnet-sdk-version }}
198+
# # - name: Download Benchmarks
199+
# # uses: actions/download-artifact@v4
200+
# # with:
201+
# # pattern: benchmark-*
202+
# # path: ${{ runner.temp }}/benchmarks/
203+
# # merge-multiple: false
204+
# # - run: |
205+
# # echo -e '\n## Windows' >> ${{ github.workspace}}/docfx/benchmarks/index.md
206+
# # cat benchmark-windows-latest/**/*.md >> ${{ github.workspace}}/docfx/benchmarks/index.md
207+
# # echo -e '\n## Linux' >> ${{ github.workspace}}/docfx/benchmarks/index.md
208+
# # cat benchmark-ubuntu-latest/**/*.md >> ${{ github.workspace}}/docfx/benchmarks/index.md
209+
# # echo -e '\n## macOS' >> ${{ github.workspace}}/docfx/benchmarks/index.md
210+
# # cat benchmark-macos-latest/**/*.md >> ${{ github.workspace}}/docfx/benchmarks/index.md
211+
# # working-directory: ${{ runner.temp }}/benchmarks/
212+
# # - run: dotnet tool update -g docfx
213+
# # - run: docfx ./docfx/docfx.json
214+
# # - name: Upload artifact
215+
# # uses: actions/upload-pages-artifact@v4
216+
# # with:
217+
# # path: './docs'
218+
# # - name: Deploy to GitHub Pages
219+
# # id: deployment
220+
# # uses: actions/deploy-pages@v4
221+
222+
# publish-package-internal:
223+
# if: ${{ !github.env.is_release }}
224+
# name: Publish package with .NET CLI
225+
# needs: [pack]
226+
# environment:
227+
# name: private-nuget-feed
228+
# runs-on: ubuntu-latest
229+
# steps:
230+
# - name: 'Checkout ${{ github.head_ref || github.ref }}'
231+
# uses: actions/checkout@v4
232+
# - name: Dotnet Setup
233+
# uses: actions/setup-dotnet@v4
234+
# with:
235+
# dotnet-version: ${{ env.dotnet-sdk-version }}
236+
# - name: Download Packages
237+
# uses: actions/download-artifact@v4
238+
# with:
239+
# name: package
240+
# path: ${{ runner.temp }}/packages/
241+
# - run: |
242+
# dotnet nuget add source ${{ secrets.PRIVATE_NUGET_PACKAGE_FEED_URL }} --name private-feed --username username --password ${{ secrets.PRIVATE_NUGET_PACKAGE_FEED_API_KEY }} --store-password-in-clear-text
243+
# dotnet nuget push **/*.nupkg --source private-feed --api-key ${{ secrets.PRIVATE_NUGET_PACKAGE_FEED_API_KEY }}
244+
# working-directory: ${{ runner.temp }}/packages/
245+
246+
# release-package:
247+
# if: ${{ github.env.is_release }}
248+
# name: Release package with .NET CLI
249+
# needs: [pack, test]
250+
# environment:
251+
# name: public-nuget-feed
252+
# runs-on: ubuntu-latest
253+
# steps:
254+
# - name: 'Checkout ${{ github.head_ref || github.ref }}'
255+
# uses: actions/checkout@v4
256+
# - name: Dotnet Setup
257+
# uses: actions/setup-dotnet@v4
258+
# with:
259+
# dotnet-version: ${{ env.dotnet-sdk-version }}
260+
# - name: Download Packages
261+
# uses: actions/download-artifact@v4
262+
# with:
263+
# name: package
264+
# path: ${{ runner.temp }}/packages/
265+
# - run: |
266+
# dotnet nuget push **/*.nupkg --source ${{ vars.PUBLIC_NUGET_PACKAGE_FEED_URL }} --api-key ${{ secrets.PUBLIC_NUGET_PACKAGE_FEED_API_KEY }}
267+
# working-directory: ${{ runner.temp }}/packages/

0 commit comments

Comments
 (0)