parent
639f59459b
commit
beb1800dc8
|
|
@ -190,10 +190,11 @@ jobs:
|
||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
steps:
|
steps:
|
||||||
- id: set-tag
|
- id: set-tag
|
||||||
run: echo "tag=release-$(TZ=+8 date '+%Y-%m-%d_%H_%M_%S')" >> $GITHUB_OUTPUT # 把变量输出到github的输出环境,上面的outputs就能获取到
|
# run: echo "tag=release-$(TZ=+8 date '+%Y-%m-%d_%H_%M_%S')" >> $GITHUB_OUTPUT # 把变量输出到github的输出环境,上面的outputs就能获取到
|
||||||
|
run: echo "tag=release-$(TZ='Asia/Shanghai' date '+%Y-%m-%d_%H_%M_%S')" >> $GITHUB_OUTPUT
|
||||||
- name: Create a File
|
- name: Create a File
|
||||||
run: |
|
run: |
|
||||||
echo "$(TZ=+8 date '+%Y%m%d%H%M%S') hello from ${{ matrix.runs-on }}" > file-${{ matrix.runs-on }}.txt
|
echo "$(TZ='Asia/Shanghai' date '+%Y%m%d%H%M%S') hello from ${{ matrix.runs-on }}" > file-${{ matrix.runs-on }}.txt
|
||||||
echo '{"version": "1.0.0", "build": "1234"}' > meta.json # 跨job传递参数
|
echo '{"version": "1.0.0", "build": "1234"}' > meta.json # 跨job传递参数
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3 #github公开版可以用v4
|
uses: actions/upload-artifact@v3 #github公开版可以用v4
|
||||||
|
|
@ -206,6 +207,11 @@ jobs:
|
||||||
needs: upload
|
needs: upload
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- 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: 获取跨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
|
||||||
|
|
@ -252,13 +258,17 @@ jobs:
|
||||||
echo "获取gitea: ${{ gitea.repository }}"
|
echo "获取gitea: ${{ gitea.repository }}"
|
||||||
- name: 上传Release
|
- name: 上传Release
|
||||||
uses: softprops/action-gh-release@v2
|
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 # 加载文本的路径,用于传达此版本中的显著变化
|
# 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 }}
|
||||||
|
name: "Release ${{ steps.vars.outputs.tag }}"
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
*.txt
|
*.txt
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue