36
36
os : [ubuntu-latest, windows-latest, macos-latest]
37
37
runs-on : ${{ matrix.os }}
38
38
steps :
39
- - name : Print messages
40
- run : |
41
- echo "PR ${{github.event.pull_request.number}} at ${{github.event.pull_request.url}}"
42
- echo "Base repo = ${{github.context.repo.owner}}/${{github.context.repo.repo}}, SHA = ${{github.event.pull_request.head.sha||github.sha}}"
43
- - name : Dump event object
44
- run : |
45
- echo "${{toJSON(github.event)}}"
46
39
- name : Setup PostgreSQL
47
40
uses : ikalnytskyi/action-setup-postgres@v4
48
41
with :
73
66
Write-Host "$(pwsh --version) is installed at $PSHOME"
74
67
psql --version
75
68
Write-Host "Using .NET SDK: $(dotnet --version)"
69
+ #
70
+ - name : Print messages
71
+ shell : pwsh
72
+ env :
73
+ # MY_MSG: ${{ github.event.pull_request.merged == true && ('#'github.event.pull_request.number) || github.sha }}
74
+ MY_MSG : ${{ github.event_name == 'pull_request' && ('#'github.event.pull_request.number) || github.sha }}
75
+ run : |
76
+ # github.event.pull_request.merged == true
77
+ Write-Host "Message = "$env:MY_MSG"
78
+
79
+
80
+ # For a PR:
81
+ # Auto-generated documentation from [1294](https://github.com/json-api-dotnet/JsonApiDotNetCore/pull/1294)
82
+ # For a commit
83
+ # Auto-generated documentation from {auto}
84
+ #echo "PR ${{github.event.pull_request.number}} at ${{github.event.pull_request.url}}"
85
+ #echo "Base repo = ${{github.context.repo.owner}}/${{github.context.repo.repo}}, SHA = ${{github.event.pull_request.head.sha||github.sha}}"
86
+ - name : Dump event object
87
+ run : |
88
+ echo "${{toJSON(github.event)}}"
89
+ #
76
90
- name : Git checkout
77
91
uses : actions/checkout@v3
78
92
- name : Restore tools
@@ -112,26 +126,26 @@ jobs:
112
126
shell : pwsh
113
127
run : |
114
128
dotnet build --no-restore --configuration Release --version-suffix=$env:PACKAGE_VERSION_SUFFIX
115
- - name : Test
116
- run : |
117
- dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true" -- RunConfiguration.CollectSourceInformation=true DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true
118
- - name : Upload coverage to codecov.io
119
- if : matrix.os == 'ubuntu-latest'
120
- uses : codecov/codecov-action@v3
121
- - name : Generate packages
122
- shell : pwsh
123
- run : |
124
- dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages --version-suffix=$env:PACKAGE_VERSION_SUFFIX
125
- - name : Upload packages to artifacts
126
- if : matrix.os == 'ubuntu-latest'
127
- uses : actions/upload-artifact@v3
128
- with :
129
- name : packages
130
- path : artifacts/packages
129
+ # - name: Test
130
+ # run: |
131
+ # dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true" -- RunConfiguration.CollectSourceInformation=true DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true
132
+ # - name: Upload coverage to codecov.io
133
+ # if: matrix.os == 'ubuntu-latest'
134
+ # uses: codecov/codecov-action@v3
135
+ # - name: Generate packages
136
+ # shell: pwsh
137
+ # run: |
138
+ # dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages --version-suffix=$env:PACKAGE_VERSION_SUFFIX
139
+ # - name: Upload packages to artifacts
140
+ # if: matrix.os == 'ubuntu-latest'
141
+ # uses: actions/upload-artifact@v3
142
+ # with:
143
+ # name: packages
144
+ # path: artifacts/packages
131
145
- name : Generate documentation
132
146
shell : pwsh
133
147
env :
134
- # This contains the git tag name on release; in that case we build but don't publish .
148
+ # This contains the git tag name on release; in that case we build the docs without publishing .
135
149
DOCFX_SOURCE_BRANCH_NAME : ${{ github.base_ref || github.ref_name }}
136
150
run : |
137
151
Write-Host "Using docfx branch name: $env:DOCFX_SOURCE_BRANCH_NAME"
@@ -232,7 +246,7 @@ jobs:
232
246
shell : pwsh
233
247
run : |
234
248
# Not using the environment variables for SHAs, because they may be outdated. This happens on force-push after the build is queued, but before it starts.
235
- # The below works because HEAD is detached (at the merge commit), so HEAD~1 is at the base branch.
249
+ # The below works because HEAD is detached (at the merge commit), so HEAD~1 is at the base branch. When a PR contains no commits, this job will not run.
236
250
$headCommitHash = git rev-parse HEAD
237
251
$baseCommitHash = git rev-parse HEAD~1
238
252
@@ -248,8 +262,9 @@ jobs:
248
262
publish :
249
263
timeout-minutes : 60
250
264
runs-on : ubuntu-latest
251
- needs : [ build-and-test, inspect-code, cleanup-code ]
252
- if : ${{ !github.event.pull_request.head.repo.fork }}
265
+ needs : [ build-and-test ]
266
+ # needs: [ build-and-test, inspect-code, cleanup-code ]
267
+ # if: ${{ !github.event.pull_request.head.repo.fork }}
253
268
permissions :
254
269
packages : write
255
270
contents : write
@@ -264,11 +279,13 @@ jobs:
264
279
dotnet nuget add source --username 'json-api-dotnet' --password "$env:GITHUB_TOKEN" --store-password-in-clear-text --name 'github' 'https://nuget.pkg.github.com/json-api-dotnet/index.json'
265
280
dotnet nuget push "$env:GITHUB_WORKSPACE/packages/*.nupkg" --api-key "$env:GITHUB_TOKEN" --source 'github'
266
281
- name : Publish documentation
267
- if : github.event_name == 'push' && github.ref == 'refs/heads/master'
282
+ # if: github.event_name == 'push' && github.ref == 'refs/heads/master'
268
283
uses : peaceiris/actions-gh-pages@v3
269
284
with :
270
285
github_token : ${{ secrets.GITHUB_TOKEN }}
271
- publish_branch : gh-pages
286
+ # TODO: Revert
287
+ publish_branch : gh-pages-test
288
+ # publish_branch: gh-pages
272
289
publish_dir : ./documentation
273
290
commit_message : ' Auto-generated documentation from: ${{ github.event.head_commit.message }}'
274
291
- name : Publish to NuGet
0 commit comments