Skip to content

Commit

Permalink
fix(ci): properly detect @tauri-apps/cli release id from covector out…
Browse files Browse the repository at this point in the history
…put (#8004)
  • Loading branch information
lucasfernog authored Oct 11, 2023
1 parent f552c17 commit bab05ff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
11 changes: 11 additions & 0 deletions .scripts/covector/parse-output.js
Original file line number Diff line number Diff line change
@@ -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])

0 comments on commit bab05ff

Please sign in to comment.