Skip to content

Commit 99b3310

Browse files
Simplify
1 parent 7d7396f commit 99b3310

File tree

1 file changed

+17
-32
lines changed

1 file changed

+17
-32
lines changed

.github/workflows/deploy.yml

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,23 @@ jobs:
3333
- name: Checkout 🛎️
3434
uses: actions/checkout@v4
3535

36-
- name: Download Web artifact to site directory
37-
if: ${{ inputs.deployWeb }}
36+
- name: Download ZIP artifacts
3837
uses: dawidd6/action-download-artifact@v6
3938
with:
4039
workflow: dotnet.yml
4140
branch: master
4241
name_is_regexp: true
43-
name: ICSharpCode\.CodeConverter\.Web\..*\.zip
44-
path: site-temp
45-
46-
- name: Get web folder name
47-
if: ${{ inputs.deployWeb }}
48-
id: web_folder
42+
name: ICSharpCode\.CodeConverter.*\.zip$
43+
path: release-artifacts
44+
skip_unpack:
45+
46+
- name: Rename ZIP files
4947
shell: pwsh
5048
run: |
51-
$subDir = Get-ChildItem -Path site-temp -Directory | Select-Object -First 1
52-
$path = if ($subDir) { "site-temp/$($subDir.Name)" } else { "site-temp" }
53-
Write-Output "path=$path" >> $env:GITHUB_OUTPUT
49+
Get-ChildItem -Path release-artifacts -Filter "*.zip.zip" | ForEach-Object {
50+
$newName = $_.Name -replace '\.zip\.zip$', '.zip'
51+
Rename-Item -Path $_.FullName -NewName $newName
52+
}
5453
5554
- name: Download NuGet and VSIX artifacts
5655
if: ${{ inputs.createRelease || inputs.publishNuget }}
@@ -63,25 +62,11 @@ jobs:
6362
path: release-artifacts
6463
skip_unpack: false
6564

66-
- name: Download ZIP artifacts
67-
if: ${{ inputs.createRelease }}
68-
uses: dawidd6/action-download-artifact@v6
69-
with:
70-
workflow: dotnet.yml
71-
branch: master
72-
name_is_regexp: true
73-
name: ICSharpCode\.CodeConverter.*\.zip$
74-
path: release-artifacts
75-
skip_unpack: true
76-
77-
- name: Rename ZIP files
78-
if: ${{ inputs.createRelease }}
65+
- name: Extract web files
66+
if: ${{ inputs.deployWeb }}
7967
shell: pwsh
8068
run: |
81-
Get-ChildItem -Path release-artifacts -Filter "*.zip.zip" | ForEach-Object {
82-
$newName = $_.Name -replace '\.zip\.zip$', '.zip'
83-
Rename-Item -Path $_.FullName -NewName $newName
84-
}
69+
Expand-Archive -Path release-artifacts/ICSharpCode.CodeConverter.Web.*.zip -DestinationPath site -Force
8570
8671
- name: Extract build version from artifacts
8772
id: get_version
@@ -103,14 +88,14 @@ jobs:
10388
run: |
10489
./Get-LatestChangelog.ps1 -Path CHANGELOG.md | Tee-Object -FilePath release-notes.md
10590
106-
- name: Deploy to GitHub Pages 🚀
91+
- name: Publish web to GitHub Pages 🚀
10792
if: ${{ inputs.deployWeb }}
10893
uses: JamesIves/github-pages-deploy-action@v4
10994
with:
11095
branch: 'autoupdated/gh-pages'
111-
folder: ${{ steps.web_folder.outputs.path }}
96+
folder: 'site'
11297

113-
- name: Publish NuGet packages
98+
- name: Publish NuGet packages (tool and library)
11499
if: ${{ inputs.publishNuget }}
115100
shell: pwsh
116101
env:
@@ -124,7 +109,7 @@ jobs:
124109
dotnet nuget push $package.FullName -k $env:NUGET_API_KEY -s $source --skip-duplicate
125110
}
126111
127-
- name: Create GitHub release
112+
- name: Publish GitHub release with changelog
128113
if: ${{ inputs.createRelease }}
129114
uses: softprops/action-gh-release@v2
130115
with:

0 commit comments

Comments
 (0)