更新 .gitea/workflows/demo.yaml

测试自动提交tag,发布生产
This commit is contained in:
xiehaijun 2025-07-27 14:48:16 +00:00
parent 739aa8327e
commit 444d0c7c0f
1 changed files with 8 additions and 2 deletions

View File

@ -212,6 +212,12 @@ jobs:
- name: Set release tag as date - name: Set release tag as date
id: vars id: vars
run: echo "tag=release-$(TZ='Asia/Shanghai' date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT # 包含$GITHUB_ENV 的作用域,全steps也可访问 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的输出变量值 - name: 获取跨job上游job的输出变量值
run: echo "The tag from previous job is ${{ needs.upload.outputs.tag-name }}" run: echo "The tag from previous job is ${{ needs.upload.outputs.tag-name }}"
- name: Download All Artifacts - name: Download All Artifacts
@ -260,14 +266,14 @@ jobs:
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
#env: #env:
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} #GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#if: github.ref_type == 'tag' if: github.ref_type == 'tag'
# body_path: ${{ github.workspace }}-CHANGELOG.txt # 加载文本的路径,用于传达此版本中的显著变化 # body_path: ${{ github.workspace }}-CHANGELOG.txt # 加载文本的路径,用于传达此版本中的显著变化
# repository: my_gh_org/my_gh_repo # repository: my_gh_org/my_gh_repo
# token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} # token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
# name: 发布名称。默认为标签名称 # name: 发布名称。默认为标签名称
# tag_name: 标签名称。默认为github.ref_name # tag_name: 标签名称。默认为github.ref_name
#tag_name: ${{ needs.upload.outputs.tag-name }} #tag_name: ${{ needs.upload.outputs.tag-name }}
tag_name: ${{ steps.vars.outputs.tag }} #tag_name: ${{ steps.vars.outputs.tag }}
with: with:
files: | files: |
*.txt *.txt