diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3dc3c43..4ad4b35 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 @@ -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 @@ -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 });