Skip to content

Commit

Permalink
Fix release workflow asset upload
Browse files Browse the repository at this point in the history
  • Loading branch information
catuhana committed Nov 29, 2023
1 parent 381cdc4 commit 032c3a4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
permissions:
contents: write
outputs:
release-upload-url: ${{ steps.create-release.outputs.result }}
release-id: ${{ steps.create-release.outputs.result }}
steps:
- name: Create release
id: create-release
Expand All @@ -36,7 +36,7 @@ jobs:
generate_release_notes: true
});
return release.data.upload_url;
return release.data.id;
build-and-upload:
name: Build and Upload
Expand Down Expand Up @@ -69,14 +69,12 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const asset = await (await import("node:fs")).readFile("target/release/${github.repository.name}${{ runner.os == 'Windows' && '.exe' || '' }}");
const asset = await (await import("node:fs")).readFile(`target/release/${github.repository.name}${{ runner.os == 'Windows' && '.exe' || '' }}`);
await github.rest.repos.uploadReleaseAsset({
url: ${{ needs.create-release.outputs.release-upload-url }},
owner: context.repo.owner,
repo: context.repo.repo,
release_id: ${{ needs.create-release.outputs.release-id }},
name: "lure-release-${{ runner.os }}",
data: asset,
headers: {
'Content-Type': 'application/octet-stream',
'Content-Length': asset.length
}
data: asset
});

0 comments on commit 032c3a4

Please sign in to comment.