[CI] 不小心写到linux了

This commit is contained in:
2026-01-03 22:23:16 +08:00
parent 227c156942
commit 17d1978f2b

View File

@@ -31,14 +31,13 @@ jobs:
- name: 设置版本 - name: 设置版本
run: | run: |
if ('${{ github.event_name }}' -eq 'workflow_dispatch') { if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
$VERSION = '${{ inputs.version }}' VERSION="${{ inputs.version }}"
} else { else
$VERSION = '${{ github.ref }}' -replace 'refs/tags/', '' VERSION="${GITHUB_REF#refs/tags/}"
} fi
Write-Host "构建版本: $VERSION" echo "构建版本: $VERSION"
# Gitea Actions 设置环境变量的正确方式 echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
- name: 构建项目 (Linux) - name: 构建项目 (Linux)
run: | run: |
@@ -145,16 +144,14 @@ jobs:
- name: 设置版本 - name: 设置版本
run: | run: |
powershell -Command "
if ('${{ github.event_name }}' -eq 'workflow_dispatch') { if ('${{ github.event_name }}' -eq 'workflow_dispatch') {
`$VERSION = '${{ inputs.version }}' $VERSION = '${{ inputs.version }}'
} else { } else {
`$VERSION = '${{ github.ref }}' -replace 'refs/tags/', '' $VERSION = '${{ github.ref }}' -replace 'refs/tags/', ''
} }
# 设置环境变量 Write-Host "构建版本: $VERSION"
Add-Content -Path `$env:GITHUB_ENV -Value \"VERSION=`$VERSION\" # Gitea Actions 设置环境变量的正确方式
Write-Host \"Windows构建版本: `$VERSION\" echo "VERSION=$VERSION" >> $env:GITHUB_ENV
"
- name: 构建项目 (Windows Native) - name: 构建项目 (Windows Native)
run: | run: |