Skip to content

Commit 3fdcd4a

Browse files
committed
Try switch to use Powershell with windows 2022.
1 parent 8ae3d59 commit 3fdcd4a

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

.github/workflows/static.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,13 @@ jobs:
3939
uses: actions/setup-dotnet@v2
4040
with:
4141
dotnet-version: '6.x'
42-
- name: Set up MinGW
43-
uses: egor-tensin/setup-mingw@v2
44-
with:
45-
platform: x64
4642
- name: Download docfx
47-
run: wget https://github.com/dotnet/docfx/releases/download/v2.59.4/docfx.zip
43+
run: |
44+
client = new-object System.Net.WebClient
45+
$client.DownloadFile("https://github.com/dotnet/docfx/releases/download/v2.59.4/docfx.zip")
4846
- name: Setup docfx
4947
run: |
50-
unzip ./docfx.zip -d ./docfx
51-
chmod +x ./docfx/docfx.exe
48+
Expand-Archive ./docfx.zip -d ./docfx
5249
./docfx/docfx.exe --version
5350
echo "${GITHUB_WORKSPACE}/docfx" >> $GITHUB_PATH
5451
- name: Checkout DocFxMarkdownGen
@@ -63,11 +60,10 @@ jobs:
6360
path: ServiceStack
6461
- name: Change docfx.json path for CI
6562
run: |
66-
sed -i 's|../ServiceStack/ServiceStack|./ServiceStack/ServiceStack|g' docfx.json
63+
(Get-Content -path docfx.json -Raw) -replace '../ServiceStack/ServiceStack','./ServiceStack/ServiceStack' | Set-Content -Path docfx.json
6764
- name: Build docs
6865
run: |
69-
chmod +x ./generate.sh
70-
./generate.sh
66+
./generate.ps1
7167
- name: Deploy to GitHub Pages
7268
uses: peaceiris/actions-gh-pages@v3
7369
with:

generate.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
docfx metadata
2+
Get-ChildItem './api/*.yml' | ForEach {
3+
(Get-Content $_) | ForEach {$_ -Replace 'git@github.com:ServiceStack/ServiceStack.git', 'https://github.com/ServiceStack/ServiceStack'} | Set-Content $_
4+
}
5+
if (Test-Path -Path './DocFxMarkdownGen') {
6+
echo "Already exists, skipping DocFXMarkdownGen clone"
7+
} else {
8+
git clone git@github.com:Layoric/DocFxMarkdownGen.git
9+
}
10+
cd DocFxMarkdownGen
11+
dotnet publish -r win-x86 -p:PublishSingleFile=true --self-contained false -o ../out
12+
cd ..
13+
Copy-Item "./out/DocFxMarkdownGen.exe" -Destination "./dfmg.exe"
14+
./dfmg.exe
15+
yarn install
16+
npm run build

0 commit comments

Comments
 (0)