修复工作流错误
This commit is contained in:
33
.github/workflows/dotnet-desktop.yml
vendored
33
.github/workflows/dotnet-desktop.yml
vendored
@@ -23,44 +23,57 @@ jobs:
|
|||||||
- name: Setup .NET SDK
|
- name: Setup .NET SDK
|
||||||
uses: actions/setup-dotnet@v3
|
uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
dotnet-version: "8.0.x"
|
||||||
|
|
||||||
- name: Extract version from csproj
|
- name: Extract version from csproj
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
id: extract_version
|
|
||||||
run: |
|
run: |
|
||||||
[xml]$proj = Get-Content "${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj"
|
[xml]$proj = Get-Content "$env:PROJECT_NAME\$env:PROJECT_NAME.csproj"
|
||||||
$VERSION_NUM = $proj.Project.PropertyGroup.Version
|
$VERSION_NUM = $proj.Project.PropertyGroup.Version
|
||||||
$VERSION_TAG = "v$VERSION_NUM"
|
$VERSION_TAG = "v$VERSION_NUM"
|
||||||
${env:VERSION} = $VERSION_NUM
|
"VERSION=$VERSION_TAG" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Check Version Tag
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
if (-not $env:VERSION) {
|
||||||
|
Write-Error "Version tag not found in csproj file."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
Write-Host "Version tag found: $env:VERSION"
|
||||||
|
|
||||||
- name: Tag merge commit
|
- name: Tag merge commit
|
||||||
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git tag "${{ env.VERSION }}"
|
git tag $env:VERSION
|
||||||
git push --tags
|
git push --tags
|
||||||
|
|
||||||
- name: Publish FrameworkDependent version
|
- name: Publish FrameworkDependent version
|
||||||
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
dotnet publish ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj -c Release -r win-x64 --sc false -o "publish/${{ env.PROJECT_NAME }}-${{ env.VERSION }}"
|
dotnet publish "$env:PROJECT_NAME\$env:PROJECT_NAME.csproj" -c Release -r win-x64 --sc false -o "publish\$env:PROJECT_NAME-$env:VERSION"
|
||||||
|
|
||||||
- name: Publish SelfContained version
|
- name: Publish SelfContained version
|
||||||
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
dotnet publish ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj -c Release -r win-x64 --sc true -o "publish/${{ env.PROJECT_NAME }}-${{ env.VERSION }}-SelfContained"
|
dotnet publish "$env:PROJECT_NAME\$env:PROJECT_NAME.csproj" -c Release -r win-x64 --sc true -o "publish\$env:PROJECT_NAME-$env:VERSION-SelfContained"
|
||||||
|
|
||||||
- name: Create release directory
|
- name: Create release directory
|
||||||
run: mkdir release
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
New-Item -ItemType Directory -Path release -Force | Out-Null
|
||||||
|
|
||||||
- name: Compress FrameworkDependent version
|
- name: Compress FrameworkDependent version
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
Compress-Archive -Path "publish/${env:PROJECT_NAME}-${env:VERSION}" -DestinationPath "release/${env:PROJECT_NAME}-${env:VERSION}.zip" -Force
|
Compress-Archive -Path "publish\$env:PROJECT_NAME-$env:VERSION\*" -DestinationPath "release\$env:PROJECT_NAME-$env:VERSION.zip" -Force
|
||||||
|
|
||||||
- name: Compress SelfContained version
|
- name: Compress SelfContained version
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
Compress-Archive -Path "publish/${env:PROJECT_NAME}-${env:VERSION}-SelfContained" -DestinationPath "release/${env:PROJECT_NAME}-${env:VERSION}-SelfContained.zip" -Force
|
Compress-Archive -Path "publish\$env:PROJECT_NAME-$env:VERSION-SelfContained\*" -DestinationPath "release\$env:PROJECT_NAME-$env:VERSION-SelfContained.zip" -Force
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
id: create_release
|
id: create_release
|
||||||
|
|||||||
Reference in New Issue
Block a user