Skip to content

Commit c91b832

Browse files
author
Petr Sramek
committed
update
1 parent 90ffe28 commit c91b832

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,24 @@ env:
2727
nuget-packages-directory: 'nuget-packages'
2828

2929
jobs:
30-
variables:
31-
name: 'GitHub variables'
30+
global-variables:
31+
name: 'Global variables'
3232
runs-on: ubuntu-latest
3333

3434
outputs:
3535
github-run-id: ${{ github.run_id }}
3636
github-run-number: ${{ github.run_number }}
37+
is-release: ${{ startsWith(github.ref_name, 'release') }}
38+
is-preview: ${{ startsWith(github.ref_name, 'preview') }}
3739

3840
steps:
39-
- name: 'GitHub variables'
41+
- name: 'Global variables'
4042
id: github
4143
run: |
42-
echo "github.run_id=${{ github.run_id }}"
43-
echo "github.run_number=${{ github.run_number }}"
44+
echo "github-run-id:${{ github.run_id }}"
45+
echo "github-run-number:${{ github.run_number }}"
46+
echo "is-release:${{ github.run_id }}"
47+
echo "is-preview:${{ github.run_number }}"
4448
4549
versioning:
4650
name: Versioning with GitVersion
@@ -49,7 +53,7 @@ jobs:
4953
uses: ./.github/workflows/determine-version.yml
5054
with:
5155
config-file-path: './.gitversion/version.yml'
52-
run-number: ${{ needs.variables.outputs.github-run-number }}
56+
run-number: ${{ needs.global-variables.outputs.github-run-number }}
5357

5458
build:
5559
name: Build with .NET
@@ -149,26 +153,26 @@ jobs:
149153
publish-dev-package:
150154
name: 'Publish'
151155
uses: ./.github/workflows/release-nuget-package.yml
152-
needs: [pack,variables]
156+
needs: [variables, pack]
153157

154158
secrets: inherit
155159

156160
with:
157-
artifact-run-id: ${{ needs.variables.outputs.github-run-id }}
161+
artifact-run-id: ${{ needs.global-variables.outputs.github-run-id }}
158162
artifact-name: ${{ needs.pack.outputs.package-artifact-name }}
159163
nuget-feed-server: 'AzureArtifacts'
160164
environment: 'Development'
161165

162166
publish-production-package:
163-
if: ${{ env.is-release || env.is-preview }}
167+
if: ${{ needs.global-variables.outputs.is-release || needs.global-variables.outputs.is-preview }}
164168
name: 'Publish'
165169
uses: ./.github/workflows/release-nuget-package.yml
166-
needs: [pack,variables]
170+
needs: [variables, pack]
167171

168172
secrets: inherit
169173

170174
with:
171-
artifact-run-id: ${{ needs.variables.outputs.github-run-id }}
175+
artifact-run-id: ${{ needs.global-variables.outputs.github-run-id }}
172176
artifact-name: ${{ needs.pack.outputs.package-artifact-name }}
173177
nuget-feed-server: 'NuGet'
174178
environment: 'NuGet'

0 commit comments

Comments
 (0)