From 03c368f8a2abfb7e242b49592fd0d5f3cb14ff42 Mon Sep 17 00:00:00 2001 From: xiehaijun Date: Sun, 27 Jul 2025 14:48:16 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/demo.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 测试自动提交tag,发布生产 --- .gitea/workflows/demo.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index d8df14f..5eac95b 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -212,6 +212,12 @@ jobs: - name: Set release tag as date id: vars run: echo "tag=release-$(TZ='Asia/Shanghai' date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT # 包含$GITHUB_ENV 的作用域,全steps也可访问 + - name: 自定提交tag + run: | + git config user.name "github-actions" + git config user.email "actions@github.com" + git tag -a ${{ steps.vars.outputs.tag }} -m "Automated release" + git push origin ${{ steps.vars.outputs.tag }} - name: 获取跨job上游job的输出变量值 run: echo "The tag from previous job is ${{ needs.upload.outputs.tag-name }}" - name: Download All Artifacts @@ -260,14 +266,14 @@ jobs: uses: softprops/action-gh-release@v2 #env: #GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - #if: github.ref_type == 'tag' + if: github.ref_type == 'tag' # body_path: ${{ github.workspace }}-CHANGELOG.txt # 加载文本的路径,用于传达此版本中的显著变化 # repository: my_gh_org/my_gh_repo # token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} # name: 发布名称。默认为标签名称 # tag_name: 标签名称。默认为github.ref_name #tag_name: ${{ needs.upload.outputs.tag-name }} - tag_name: ${{ steps.vars.outputs.tag }} + #tag_name: ${{ steps.vars.outputs.tag }} with: files: | *.txt