Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract version from Directory.Packages.props
id: get_version
run: |
# Extract Version and VersionSuffix from Directory.Packages.props
VERSION_TEMPLATE=$(grep -oP '(?<=<Version>)[^<]*' Directory.Packages.props)
VERSION_SUFFIX=$(grep -oP '(?<=<VersionSuffix>)[^<]*' Directory.Packages.props)

# Replace $(VersionSuffix) with actual value
VERSION=$(echo "$VERSION_TEMPLATE" | sed "s/\$(VersionSuffix)/$VERSION_SUFFIX/g")

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version template: $VERSION_TEMPLATE"
echo "Version suffix: $VERSION_SUFFIX"
echo "Final version: $VERSION"

- name: Build and push koala-wiki
uses: docker/build-push-action@v5
Expand All @@ -51,4 +65,4 @@ jobs:
push: true
tags: |
crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:latest
crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:0.9.0
crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:${{ steps.get_version.outputs.version }}
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,12 @@ jobs:
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
# 从Directory.Packages.props文件中提取版本号
version=$(powershell -Command "[xml]\$xml = Get-Content 'Directory.Packages.props'; \$xml.Project.PropertyGroup.Version")
echo "version=v$version" >> $GITHUB_OUTPUT
# 从Directory.Packages.props文件中提取版本号并解析MSBuild变量
VERSION_TEMPLATE=$(grep -oP '(?<=<Version>)[^<]*' Directory.Packages.props)
VERSION_SUFFIX=$(grep -oP '(?<=<VersionSuffix>)[^<]*' Directory.Packages.props)
VERSION=$(echo "$VERSION_TEMPLATE" | sed "s/\$(VersionSuffix)/$VERSION_SUFFIX/g")
echo "version=v$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"
fi
shell: bash

Expand Down