|
11 | 11 | runs-on: ubuntu-latest |
12 | 12 | outputs: |
13 | 13 | release_id: ${{ steps.create-release.outputs.result }} |
| 14 | + upload_url: ${{ steps.create-release.outputs.upload_url }} |
14 | 15 |
|
15 | 16 | steps: |
16 | 17 | - uses: actions/checkout@v4 |
|
27 | 28 | uses: actions/github-script@v7 |
28 | 29 | with: |
29 | 30 | script: | |
| 31 | + function setOutput(key, value) { |
| 32 | + // Temporary hack until core actions library catches up with github new recommendations |
| 33 | + const output = process.env['GITHUB_OUTPUT'] |
| 34 | + fs.appendFileSync(output, `${key}=${value}${os.EOL}`) |
| 35 | + } |
30 | 36 | const { data } = await github.rest.repos.createRelease({ |
31 | 37 | owner: context.repo.owner, |
32 | 38 | repo: context.repo.repo, |
|
37 | 43 | draft: true, |
38 | 44 | prerelease: true |
39 | 45 | }) |
| 46 | + setOutput('upload_url', data.upload_url); |
40 | 47 | return data.id |
41 | 48 |
|
42 | 49 | build-mac-m1-node-modules: |
@@ -304,8 +311,20 @@ jobs: |
304 | 311 | tar -cvzf binDist.tar.gz -C ./src-tauri/target/release binDist |
305 | 312 | ls -alh binDist.tar.gz |
306 | 313 | GLIBC_VER=$(ldd --version | head -n1 | awk '{print $NF}') |
307 | | - mv binDist.tar.gz "binDist-needGLIBC-${GLIBC_VER}.tar.gz" |
| 314 | + OUTPUT_FILENAME="binDist-needGLIBC-${GLIBC_VER}.tar.gz" |
| 315 | + mv binDist.tar.gz "$OUTPUT_FILENAME" |
| 316 | + echo "OUTPUT_FILENAME=$OUTPUT_FILENAME" >> $GITHUB_ENV |
308 | 317 | ls |
| 318 | + - name: Upload Release Asset |
| 319 | + id: upload-release-asset |
| 320 | + uses: actions/upload-release-asset@v1 |
| 321 | + env: |
| 322 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 323 | + with: |
| 324 | + upload_url: ${{ needs.create-release.outputs.upload_url }} |
| 325 | + asset_path: ${{ env.OUTPUT_FILENAME }} |
| 326 | + asset_name: ${{ env.OUTPUT_FILENAME }} |
| 327 | + asset_content_type: application/gzip |
309 | 328 |
|
310 | 329 | publish-release: |
311 | 330 | permissions: |
|
0 commit comments