fix(ci): properly detect @tauri-apps/cli release id from covector output (#8004)

This commit is contained in:
Lucas Fernandes Nogueira 2023-10-11 12:53:01 -03:00 committed by GitHub
parent f552c1796a
commit bab05ff607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View File

@ -115,15 +115,13 @@ jobs:
repository: tauri-apps/tauri-docs
event-type: update-docs
- name: Get `@tauri-apps/cli` release id
id: cliReleaseId
- name: Process covector output
id: covectorOutput
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
run: |
echo '${{ toJSON(steps.covector.outputs) }}' > output.json
id=$(jq '.["-tauri-apps-cli-releaseId"]' < output.json)
rm output.json
id=$(node .scripts/covector/parse-output.js '${{ toJSON(steps.covector.outputs) }}' "-tauri-apps-cli-releaseId")
echo "cliReleaseId=$id" >> "$GITHUB_OUTPUT"
- name: Trigger `@tauri-apps/cli` publishing workflow
@ -135,7 +133,7 @@ jobs:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri
event-type: publish-js-cli
client-payload: '{"releaseId": "${{ steps.cliReleaseId.outputs.cliReleaseId }}" }'
client-payload: '{"releaseId": "${{ steps.covectorOutput.outputs.cliReleaseId }}" }'
- name: Trigger `tauri-cli` publishing workflow
if: |

View File

@ -0,0 +1,11 @@
#!/usr/bin/env node
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const json = process.argv[2]
const field = process.argv[3]
const output = JSON.parse(json)
console.log(output[field])