Skip to content

Commit 0c38fb0

Browse files
author
Petr Sramek
committed
test
1 parent d6e3a20 commit 0c38fb0

File tree

4 files changed

+78
-31
lines changed

4 files changed

+78
-31
lines changed

.github/actions/build/action.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ inputs:
1212
file-version:
1313
description: 'Assembly file version.'
1414
required: true
15-
treat-warnins-as-error:
16-
description: 'Treat warnings as errors.'
17-
required: true
1815
# Optional
1916
dotnet_sdk_version:
2017
description: '.NET SDK version. Default: ''9.x'''
@@ -58,11 +55,6 @@ runs:
5855
uses: actions/setup-dotnet@v4
5956
with:
6057
dotnet-version: ${{ inputs.dotnet_sdk_version }}
61-
62-
- if: ${{ inputs.treat-warnings-as-error == 'true' }}
63-
name: 'Validate warnings with .NET CLI'
64-
shell: bash
65-
run: dotnet format analyzers --severity warn --verify-no-changes
6658

6759
- name: 'Build with .NET CLI'
6860
shell: bash

.github/workflows/build.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ name: Build
22

33
on:
44
push:
5-
branches:
6-
- '**'
7-
# paths:
8-
# - 'src/**'
5+
branches-ignore:
6+
- 'release/**'
7+
- 'preview/**'
8+
paths:
9+
- 'src/**'
10+
workflow_call:
11+
outputs:
12+
build-artifact-name: ${{ needs.pack.outputs.package-artifact-name }}
913

1014
permissions:
1115
actions: read
12-
pages: write
13-
id-token: write
1416

1517
concurrency:
1618
group: build-${{ github.head_ref || github.ref }}
@@ -32,17 +34,13 @@ jobs:
3234
outputs:
3335
github-run-id: ${{ github.run_id }}
3436
github-run-number: ${{ github.run_number }}
35-
is-release: ${{ startsWith(github.ref_name, 'release') }}
36-
is-preview: ${{ startsWith(github.ref_name, 'preview') }}
3737

3838
steps:
3939
- name: 'Global variables'
4040
id: github
4141
run: |
4242
echo "github-run-id:${{ github.run_id }}"
4343
echo "github-run-number:${{ github.run_number }}"
44-
echo "is-release:${{ startsWith(github.ref_name, 'release') }}"
45-
echo "is-preview:${{ startsWith(github.ref_name, 'preview') }}"
4644
4745
versioning:
4846
name: Versioning with GitVersion
@@ -72,7 +70,6 @@ jobs:
7270
assembly-version: ${{ env.assembly-version }}
7371
assembly-informational-version: ${{ env.assembly-informational-version }}
7472
file-version: ${{ env.file-version }}
75-
treat-warnins-as-error: ${{ env.is-release }}
7673
search-glob-pattern: ${{ vars.SRC_DEFAULT_GLOB_PATTERN }}
7774

7875
test:
@@ -150,7 +147,7 @@ jobs:
150147
151148
publish-dev-package:
152149
name: 'Publish'
153-
uses: ./.github/workflows/release-nuget-package.yml
150+
uses: ./.github/workflows/publish-nuget-package.yml
154151
needs: [global-variables, pack]
155152

156153

@@ -162,19 +159,19 @@ jobs:
162159
nuget-feed-server: 'AzureArtifacts'
163160
environment: 'Development'
164161

165-
publish-production-package:
166-
if: ${{ needs.global-variables.outputs.is-release == 'true' || needs.global-variables.outputs.is-preview == 'true' }}
167-
name: 'Publish'
168-
uses: ./.github/workflows/release-nuget-package.yml
169-
needs: [global-variables, pack]
162+
# publish-production-package:
163+
# if: ${{ needs.global-variables.outputs.is-release == 'true' || needs.global-variables.outputs.is-preview == 'true' }}
164+
# name: 'Publish'
165+
# uses: ./.github/workflows/release-nuget-package.yml
166+
# needs: [global-variables, pack]
170167

171-
secrets: inherit
168+
# secrets: inherit
172169

173-
with:
174-
artifact-run-id: ${{ needs.global-variables.outputs.github-run-id }}
175-
artifact-name: ${{ needs.pack.outputs.package-artifact-name }}
176-
nuget-feed-server: 'NuGet'
177-
environment: 'NuGet'
170+
# with:
171+
# artifact-run-id: ${{ needs.global-variables.outputs.github-run-id }}
172+
# artifact-name: ${{ needs.pack.outputs.package-artifact-name }}
173+
# nuget-feed-server: 'NuGet'
174+
# environment: 'NuGet'
178175

179176
# benchmark:
180177
# if: ${{ github.env.is_release || vars.BENCHMARKDOTNET_RUN_OVERRIDE == 'true' }}

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
- 'preview/**'
8+
paths:
9+
- 'src/**'
10+
workflow_call:
11+
12+
permissions:
13+
actions: read
14+
15+
jobs:
16+
global-variables:
17+
name: 'Global variables'
18+
runs-on: ubuntu-latest
19+
20+
outputs:
21+
github-run-id: ${{ github.run_id }}
22+
github-run-number: ${{ github.run_number }}
23+
24+
steps:
25+
- name: 'Global variables'
26+
id: github
27+
run: |
28+
echo "github-run-id:${{ github.run_id }}"
29+
echo "github-run-number:${{ github.run_number }}"
30+
31+
validate:
32+
name: 'Validate'
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: 'Checkout ${{ github.head_ref || github.ref }}'
37+
uses: actions/checkout@v4
38+
39+
- name: 'Validate warnings with .NET CLI'
40+
shell: bash
41+
run: dotnet format analyzers --severity warn --verify-no-changes
42+
43+
build:
44+
name: Build
45+
uses: ./.github/workflows/build.yml
46+
47+
publish-package:
48+
name: 'Publish'
49+
uses: ./.github/workflows/publish-nuget-package.yml
50+
needs: [global-variables, build]
51+
52+
secrets: inherit
53+
54+
with:
55+
artifact-run-id: ${{ needs.global-variables.outputs.github-run-id }}
56+
artifact-name: ${{ needs.build.outputs.package-artifact-name }}
57+
nuget-feed-server: 'NuGet'
58+
environment: 'NuGet'

0 commit comments

Comments
 (0)