Skip to content

Commit 67f9966

Browse files
committed
ci: fix
[skip netlify]
1 parent 0da17b6 commit 67f9966

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
release:
5353
name: 发布更新包
5454
runs-on: ${{ matrix.platform }}
55-
55+
5656
strategy:
5757
fail-fast: false
5858
matrix:
@@ -68,30 +68,13 @@ jobs:
6868

6969
env:
7070
ENABLE_PORTABLE: ${{ contains(matrix.target, 'windows') }}
71-
71+
7272
steps:
7373
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
7474
- uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2
7575
with:
7676
bun-version-file: .tool-versions
7777

78-
- name: 获取 release ID
79-
id: get-release
80-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
81-
with:
82-
script: |
83-
const [owner, repo] = process.env.REPO.split('/');
84-
const { data } = await github.request('GET /repos/{owner}/{repo}/releases/tags/{tag}', {
85-
owner,
86-
repo,
87-
tag: process.env.REF,
88-
headers: { 'X-GitHub-Api-Version': '2022-11-28' },
89-
});
90-
return data;
91-
env:
92-
REF: ${{ github.ref_name }}
93-
REPO: ${{ github.repository }}
94-
9578
- name: 安装工具链
9679
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1
9780
with:
@@ -113,7 +96,7 @@ jobs:
11396
env:
11497
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11598
with:
116-
releaseId: ${{ fromJson(steps.get-release.outputs.result).id }}
99+
releaseId: ${{ github.event.release.id }}
117100
args: --target ${{ matrix.target }}
118101

119102
- name: 为安装包证明来源
@@ -136,15 +119,31 @@ jobs:
136119
137120
- name: 上传便携式可执行文件
138121
if: env.ENABLE_PORTABLE == 'true'
139-
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1
122+
uses: AButler/upload-release-assets@3d6774fae0ed91407dc5ae29d576b166536d1777 # v3.0
140123
with:
141-
upload_url: ${{ fromJson(steps.get-release.outputs.result).upload_url }}
142-
asset_path: ${{ steps.portable.outputs.file }}
143-
asset_name: ${{ steps.portable.outputs.file }}
144-
asset_content_type: application/zip
124+
files: ${{ steps.portable.outputs.file }}
125+
release-id: ${{ github.event.release.id }}
126+
repo-token: ${{ secrets.GITHUB_TOKEN }}
145127

146128
- name: 为便携式可执行文件证明来源
147129
if: env.ENABLE_PORTABLE == 'true'
148130
uses: actions/attest-build-provenance@f9eaf234fc1c2e333c1eca18177db0f44fa6ba52 # v2
149131
with:
150132
subject-path: ${{ steps.portable.outputs.file }}
133+
134+
attest:
135+
name: 证明来源
136+
runs-on: ubuntu-latest
137+
needs: release
138+
steps:
139+
- id: download
140+
name: 下载附件
141+
uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2 # v1
142+
with:
143+
fileName: '*'
144+
releaseId: ${{ github.event.release.id }}
145+
146+
- name: 证明来源
147+
uses: actions/attest-build-provenance@f9eaf234fc1c2e333c1eca18177db0f44fa6ba52 # v2
148+
with:
149+
subject-path: ${{ join(fromJson(steps.download.outputs.downloaded_files), ', ') }}

0 commit comments

Comments
 (0)