Skip to content

Commit ae35397

Browse files
authored
Merge pull request #286 from VaclavElias/master
feat: GitHub Actions improvments, release notes generation added
2 parents 68582a7 + f49ea61 commit ae35397

File tree

4 files changed

+72
-22
lines changed

4 files changed

+72
-22
lines changed

.github/workflows/stride-docs-github.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
name: Build Stride Docs for GitHub Staging
44

5+
env:
6+
COMMON_SETTINGS_PATH: en/docfx.json
7+
VERSION: "2.0.0.${{ github.run_number }}"
8+
DOCS_PATH: stride-docs
9+
510
on:
611
workflow_dispatch:
712

@@ -10,8 +15,7 @@ jobs:
1015
runs-on: windows-2022
1116

1217
steps:
13-
# Setup .NET SDK
14-
- name: Dotnet Setup
18+
- name: .NET SDK Setup
1519
uses: actions/setup-dotnet@v4
1620
with:
1721
dotnet-version: 8.x
@@ -20,9 +24,16 @@ jobs:
2024
- name: Checkout Stride Docs
2125
uses: actions/checkout@v4
2226
with:
23-
path: stride-docs
27+
path: ${{ env.DOCS_PATH }}
2428
lfs: true
2529

30+
- name: Set Version in docfx.json
31+
run: |
32+
$settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw
33+
$updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}"
34+
Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent
35+
shell: pwsh
36+
2637
# Checkout the Stride repository from the default branch
2738
- name: Checkout Stride (note the LFS)
2839
uses: actions/checkout@v4
@@ -40,11 +51,11 @@ jobs:
4051

4152
- name: Build documentation
4253
run: ./build-all.bat
43-
working-directory: stride-docs
54+
working-directory: ${{ env.DOCS_PATH }}
4455

4556
- name: Deploy
4657
uses: peaceiris/[email protected]
4758
with:
4859
github_token: ${{ secrets.GITHUB_TOKEN }}
49-
publish_dir: stride-docs/_site
60+
publish_dir: ${{ env.DOCS_PATH }}/_site
5061
publish_branch: gh-pages

.github/workflows/stride-docs-release-azure.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
name: Build Stride Docs for Azure Web App Release 🚀
55

6+
env:
7+
COMMON_SETTINGS_PATH: en/docfx.json
8+
VERSION: "2.0.0.${{ github.run_number }}"
9+
DOCS_PATH: stride-docs
10+
611
on:
712
push:
813
branches:
@@ -23,8 +28,7 @@ jobs:
2328
runs-on: windows-2022
2429

2530
steps:
26-
# Setup .NET SDK
27-
- name: Dotnet Setup
31+
- name: .NET SDK Setup
2832
uses: actions/setup-dotnet@v4
2933
with:
3034
dotnet-version: 8.x
@@ -33,9 +37,16 @@ jobs:
3337
- name: Checkout Stride Docs
3438
uses: actions/checkout@v4
3539
with:
36-
path: stride-docs
40+
path: ${{ env.DOCS_PATH }}
3741
lfs: true
3842

43+
- name: Set Version in docfx.json
44+
run: |
45+
$settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw
46+
$updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}"
47+
Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent
48+
shell: pwsh
49+
3950
# Checkout the Stride repository from the default branch
4051
- name: Checkout Stride (note the LFS)
4152
uses: actions/checkout@v4
@@ -53,17 +64,23 @@ jobs:
5364

5465
- name: Build documentation
5566
run: ./build-all.bat
56-
working-directory: stride-docs
67+
working-directory: ${{ env.DOCS_PATH }}
5768

5869
- name: Compress artifact
59-
run: 7z a -r DocFX-app.zip ./stride-docs/_site/*
70+
run: 7z a -r DocFX-app.zip ./${{ env.DOCS_PATH }}/_site/*
6071

6172
- name: Upload artifact for deployment job
6273
uses: actions/upload-artifact@v4
6374
with:
6475
name: DocFX-app
6576
path: DocFX-app.zip
6677

78+
- name: Create GitHub Release
79+
run: |
80+
gh release create ${{ env.VERSION }} --title "v${{ env.VERSION }}" --notes "Release notes for ${{ env.VERSION }}" --draft
81+
env:
82+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
6784
deploy:
6885
if: github.repository == 'stride3d/stride-docs'
6986
runs-on: windows-2022
@@ -83,7 +100,7 @@ jobs:
83100
# run: ls
84101

85102
- name: Decompress artifact
86-
run: 7z x DocFX-app.zip "-o./stride-docs/_site"
103+
run: 7z x DocFX-app.zip "-o./${{ env.DOCS_PATH }}/_site"
87104

88105
- name: Deploy to Azure Web App
89106
id: deploy-to-webapp
@@ -92,4 +109,4 @@ jobs:
92109
app-name: 'stride-doc'
93110
slot-name: 'Production'
94111
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4803638D673FA67D0C8650F34C4FA9D1 }}
95-
package: ./stride-docs/_site
112+
package: ./${{ env.DOCS_PATH }}/_site

.github/workflows/stride-docs-release-fast-track-azure.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
# The Fast Track skips creating artifacts and compressing them
55
name: Build Stride Docs (Fast Track) for Azure Web App Release 🚀
66

7+
env:
8+
COMMON_SETTINGS_PATH: en/docfx.json
9+
VERSION: "2.0.0.${{ github.run_number }}"
10+
DOCS_PATH: stride-docs
11+
712
on:
813
workflow_dispatch:
914

@@ -17,8 +22,7 @@ jobs:
1722
name: 'Production'
1823

1924
steps:
20-
# Setup .NET SDK
21-
- name: Dotnet Setup
25+
- name: .NET SDK Setup
2226
uses: actions/setup-dotnet@v4
2327
with:
2428
dotnet-version: 8.x
@@ -27,9 +31,16 @@ jobs:
2731
- name: Checkout Stride Docs
2832
uses: actions/checkout@v4
2933
with:
30-
path: stride-docs
34+
path: ${{ env.DOCS_PATH }}
3135
lfs: true
3236

37+
- name: Set Version in docfx.json
38+
run: |
39+
$settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw
40+
$updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}"
41+
Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent
42+
shell: pwsh
43+
3344
# Checkout the Stride repository from the default branch
3445
- name: Checkout Stride (note the LFS)
3546
uses: actions/checkout@v4
@@ -47,7 +58,7 @@ jobs:
4758

4859
- name: Build documentation
4960
run: ./build-all.bat
50-
working-directory: stride-docs
61+
working-directory: ${{ env.DOCS_PATH }}
5162

5263
- name: Deploy to Azure Web App
5364
id: deploy-to-webapp
@@ -56,4 +67,4 @@ jobs:
5667
app-name: 'stride-doc'
5768
slot-name: 'Production'
5869
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4803638D673FA67D0C8650F34C4FA9D1 }}
59-
package: ./stride-docs/_site
70+
package: ./${{ env.DOCS_PATH }}/_site

.github/workflows/stride-docs-staging-fast-track-azure.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
# The Fast Track skips creating artifacts and compressing them
55
name: Build Stride Docs (Fast Track) for Azure Web App Staging
66

7+
env:
8+
COMMON_SETTINGS_PATH: en/docfx.json
9+
VERSION: "2.0.0.${{ github.run_number }}"
10+
DOCS_PATH: stride-docs
11+
712
on:
813
workflow_dispatch:
914

@@ -17,8 +22,7 @@ jobs:
1722
name: 'Production'
1823

1924
steps:
20-
# Setup .NET SDK
21-
- name: Dotnet Setup
25+
- name: .NET SDK Setup
2226
uses: actions/setup-dotnet@v4
2327
with:
2428
dotnet-version: 8.x
@@ -27,9 +31,16 @@ jobs:
2731
- name: Checkout Stride Docs
2832
uses: actions/checkout@v4
2933
with:
30-
path: stride-docs
34+
path: ${{ env.DOCS_PATH }}
3135
lfs: true
3236

37+
- name: Set Version in docfx.json
38+
run: |
39+
$settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw
40+
$updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}"
41+
Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent
42+
shell: pwsh
43+
3344
# Checkout the Stride repository from the default branch
3445
- name: Checkout Stride (note the LFS)
3546
uses: actions/checkout@v4
@@ -47,7 +58,7 @@ jobs:
4758

4859
- name: Build documentation
4960
run: ./build-all.bat
50-
working-directory: stride-docs
61+
working-directory: ${{ env.DOCS_PATH }}
5162

5263
- name: Deploy to Azure Web App
5364
id: deploy-to-webapp
@@ -56,4 +67,4 @@ jobs:
5667
app-name: 'stride-doc'
5768
slot-name: 'staging'
5869
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_32FCD402B970463A9143B24C9B225749 }}
59-
package: ./stride-docs/_site
70+
package: ./${{ env.DOCS_PATH }}/_site

0 commit comments

Comments
 (0)