|
27 | 27 | nuget-packages-directory: 'nuget-packages' |
28 | 28 |
|
29 | 29 | jobs: |
30 | | - variables: |
31 | | - name: 'GitHub variables' |
| 30 | + global-variables: |
| 31 | + name: 'Global variables' |
32 | 32 | runs-on: ubuntu-latest |
33 | 33 |
|
34 | 34 | outputs: |
35 | 35 | github-run-id: ${{ github.run_id }} |
36 | 36 | github-run-number: ${{ github.run_number }} |
| 37 | + is-release: ${{ startsWith(github.ref_name, 'release') }} |
| 38 | + is-preview: ${{ startsWith(github.ref_name, 'preview') }} |
37 | 39 |
|
38 | 40 | steps: |
39 | | - - name: 'GitHub variables' |
| 41 | + - name: 'Global variables' |
40 | 42 | id: github |
41 | 43 | 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 }}" |
44 | 48 |
|
45 | 49 | versioning: |
46 | 50 | name: Versioning with GitVersion |
|
49 | 53 | uses: ./.github/workflows/determine-version.yml |
50 | 54 | with: |
51 | 55 | 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 }} |
53 | 57 |
|
54 | 58 | build: |
55 | 59 | name: Build with .NET |
@@ -149,26 +153,26 @@ jobs: |
149 | 153 | publish-dev-package: |
150 | 154 | name: 'Publish' |
151 | 155 | uses: ./.github/workflows/release-nuget-package.yml |
152 | | - needs: [pack,variables] |
| 156 | + needs: [variables, pack] |
153 | 157 |
|
154 | 158 | secrets: inherit |
155 | 159 |
|
156 | 160 | with: |
157 | | - artifact-run-id: ${{ needs.variables.outputs.github-run-id }} |
| 161 | + artifact-run-id: ${{ needs.global-variables.outputs.github-run-id }} |
158 | 162 | artifact-name: ${{ needs.pack.outputs.package-artifact-name }} |
159 | 163 | nuget-feed-server: 'AzureArtifacts' |
160 | 164 | environment: 'Development' |
161 | 165 |
|
162 | 166 | 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 }} |
164 | 168 | name: 'Publish' |
165 | 169 | uses: ./.github/workflows/release-nuget-package.yml |
166 | | - needs: [pack,variables] |
| 170 | + needs: [variables, pack] |
167 | 171 |
|
168 | 172 | secrets: inherit |
169 | 173 |
|
170 | 174 | with: |
171 | | - artifact-run-id: ${{ needs.variables.outputs.github-run-id }} |
| 175 | + artifact-run-id: ${{ needs.global-variables.outputs.github-run-id }} |
172 | 176 | artifact-name: ${{ needs.pack.outputs.package-artifact-name }} |
173 | 177 | nuget-feed-server: 'NuGet' |
174 | 178 | environment: 'NuGet' |
|
0 commit comments