fix: 修复自动发布工作流配置

- 修复 Docker 镜像 tag 格式错误(移除有问题的 sha prefix 配置)
- 替换 git-cliff-action 为直接使用 git-cliff CLI 工具
- 解决了 GitHub Actions 构建失败的问题

现在工作流应该可以正常运行了
This commit is contained in:
shaw
2025-07-19 22:03:12 +08:00
parent acd1d24186
commit 6a86204223
3 changed files with 25 additions and 9 deletions

View File

@@ -56,12 +56,20 @@ jobs:
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT
- name: Install git-cliff
run: |
wget -q https://github.com/orhun/git-cliff/releases/download/v1.4.0/git-cliff-1.4.0-x86_64-unknown-linux-gnu.tar.gz
tar -xzf git-cliff-1.4.0-x86_64-unknown-linux-gnu.tar.gz
chmod +x git-cliff
sudo mv git-cliff /usr/local/bin/
- name: Generate changelog - name: Generate changelog
id: changelog id: changelog
uses: orhun/git-cliff-action@v3 run: |
with: CHANGELOG=$(git-cliff --config .github/cliff.toml --unreleased --strip header || echo "- 代码优化和改进")
config: .github/cliff.toml echo "content<<EOF" >> $GITHUB_OUTPUT
args: --unreleased --strip header echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Check if there are changes to release - name: Check if there are changes to release
id: check_changes id: check_changes

View File

@@ -49,7 +49,7 @@ jobs:
type=semver,pattern={{version}} type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}} type=semver,pattern={{major}}
type=sha,prefix={{branch}}- type=sha
type=raw,value=latest,enable={{is_default_branch}} type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image - name: Build and push Docker image

View File

@@ -17,12 +17,20 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install git-cliff
run: |
wget -q https://github.com/orhun/git-cliff/releases/download/v1.4.0/git-cliff-1.4.0-x86_64-unknown-linux-gnu.tar.gz
tar -xzf git-cliff-1.4.0-x86_64-unknown-linux-gnu.tar.gz
chmod +x git-cliff
sudo mv git-cliff /usr/local/bin/
- name: Generate changelog - name: Generate changelog
id: changelog id: changelog
uses: orhun/git-cliff-action@v3 run: |
with: CHANGELOG=$(git-cliff --config .github/cliff.toml --latest --strip header)
config: .github/cliff.toml echo "content<<EOF" >> $GITHUB_OUTPUT
args: --latest --strip header echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release - name: Create Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1