Update ci.yml (#7778)

This commit is contained in:
绛亽 2023-03-25 17:48:10 +08:00 committed by Liang Ding
parent 81f0d5f33e
commit 5500cdebae
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D

View File

@ -28,14 +28,19 @@ jobs:
- name: Gather Release Information
id: release_info
# 注意:创建或更新环境变量的步骤无权访问新值;$GITHUB_OUTPUT 需要定义步骤 id 才能稍后检索输出值,$GITHUB_ENV 则不需要
# 以下转换不再需要:
# changelog="${changelog//'%'/'%25'}"
# changelog="${changelog//$'\n'/'%0A'}"
# changelog="${changelog//$'\r'/'%0D'}"
run: |
echo "::set-output name=release_title::$(git show --format=%s --no-patch | head -1)"
echo "::set-output name=release_version::$(TZ=Asia/Shanghai date +'v%Y%m%d%H%M')"
echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
echo "release_version=$(TZ=Asia/Shanghai date +'v%Y%m%d%H%M')" >> $GITHUB_OUTPUT
changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} siyuan-note/siyuan)
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo "::set-output name=release_body::$changelog"
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "release_body<<$EOF" >> $GITHUB_ENV
echo "$changelog" >> $GITHUB_ENV
echo "$EOF" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -53,7 +58,7 @@ jobs:
with:
release_name: ${{ steps.release_info.outputs.release_version }}
tag_name: ${{ github.ref }}
body: ${{ steps.release_info.outputs.release_body }}
body: ${{ env.release_body }}
draft: false
prerelease: true