Skip to content

Commit

Permalink
ci: fix
Browse files Browse the repository at this point in the history
[skip netlify]
  • Loading branch information
typed-sigterm committed Feb 27, 2025
1 parent 0da17b6 commit 67f9966
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
release:
name: 发布更新包
runs-on: ${{ matrix.platform }}

strategy:
fail-fast: false
matrix:
Expand All @@ -68,30 +68,13 @@ jobs:

env:
ENABLE_PORTABLE: ${{ contains(matrix.target, 'windows') }}

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2
with:
bun-version-file: .tool-versions

- name: 获取 release ID
id: get-release
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
const [owner, repo] = process.env.REPO.split('/');
const { data } = await github.request('GET /repos/{owner}/{repo}/releases/tags/{tag}', {
owner,
repo,
tag: process.env.REF,
headers: { 'X-GitHub-Api-Version': '2022-11-28' },
});
return data;
env:
REF: ${{ github.ref_name }}
REPO: ${{ github.repository }}

- name: 安装工具链
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1
with:
Expand All @@ -113,7 +96,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ fromJson(steps.get-release.outputs.result).id }}
releaseId: ${{ github.event.release.id }}
args: --target ${{ matrix.target }}

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

- name: 为便携式可执行文件证明来源
if: env.ENABLE_PORTABLE == 'true'
uses: actions/attest-build-provenance@f9eaf234fc1c2e333c1eca18177db0f44fa6ba52 # v2
with:
subject-path: ${{ steps.portable.outputs.file }}

attest:
name: 证明来源
runs-on: ubuntu-latest
needs: release
steps:
- id: download
name: 下载附件
uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2 # v1
with:
fileName: '*'
releaseId: ${{ github.event.release.id }}

- name: 证明来源
uses: actions/attest-build-provenance@f9eaf234fc1c2e333c1eca18177db0f44fa6ba52 # v2
with:
subject-path: ${{ join(fromJson(steps.download.outputs.downloaded_files), ', ') }}

0 comments on commit 67f9966

Please sign in to comment.