Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
abose authored Feb 14, 2024
1 parent 44b6210 commit 79d2242
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create-release.outputs.result }}

steps:
- uses: actions/checkout@v4
Expand All @@ -25,6 +27,14 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const os = require("os")
const fs = require("fs")
function setOutput(key, value) {
// Temporary hack until core actions library catches up with github new recommendations
const output = process.env['GITHUB_OUTPUT']
fs.appendFileSync(output, `${key}=${value}${os.EOL}`)
}
const { data } = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -36,8 +46,8 @@ jobs:
prerelease: true
})
console.log(data);
core.setOutput('release_id', data.id);
core.setOutput('upload_url', data.upload_url);
setOutput('upload_url', data.upload_url);
return data.id
build-linux-bins:
needs: [ create-release ]
Expand All @@ -51,10 +61,6 @@ jobs:

runs-on: ${{ matrix.platform }}
steps:
- name: Echo create-release outputs
run: |
echo "Release ID: ${{ needs.create-release.outputs.release_id }}"
echo "Upload URL: ${{ needs.create-release.outputs.upload_url }}"
- uses: actions/checkout@v4
- name: get Git Tag
shell: bash
Expand Down Expand Up @@ -82,6 +88,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.OUTPUT_FILENAME }}
asset_name: ${{ env.OUTPUT_FILENAME }}
asset_path: ${{ env.FILENAME }}
asset_name: ${{ env.FILENAME }}
asset_content_type: application/gzip

0 comments on commit 79d2242

Please sign in to comment.