Skip to content

Commit

Permalink
Extract version number
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyadanli committed Jan 14, 2025
1 parent be53e24 commit c8283b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ jobs:
${{ runner.os }}-nuget-
- name: Extract version number
id: extract_version
shell: pwsh
run: |
VERSION=$(sed -n 's/.*<AssemblyVersion>\(.*\)<\/AssemblyVersion>.*/\1/p' BetterGenshinImpact/BetterGenshinImpact.csproj)
echo "##[set-output name=VERSION;$VERSION]"
$xmlContent = Get-Content BetterGenshinImpact/BetterGenshinImpact.csproj
$version = ($xmlContent | Select-String -Pattern '<AssemblyVersion>(.*)</AssemblyVersion>').Matches.Groups[1].Value
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
- run: dotnet publish -c Release -p:PublishProfile=FolderProfile
continue-on-error: true
- uses: actions/upload-artifact@v4
Expand Down

0 comments on commit c8283b9

Please sign in to comment.