Skip to content

Commit

Permalink
Update prepare-cli.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni55aN authored Jan 6, 2024
1 parent af6aac6 commit d8a1212
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/prepare-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,20 @@ on:
type: string
required: true
outputs:
name:
description: "Package name"
value: ${{ jobs.pack.outputs.name }}
artifact:
description: "Artifact name"
value: ${{ jobs.pack.outputs.artifact }}
path:
description: "Path to package"
value: ${{ jobs.pack.outputs.source == 'github' && jobs.pack.outputs.tarball || jobs.pack.outputs.name }}
artifact:
description: "Tarball path"
value: ${{ jobs.pack.outputs.tarball }}
value: ${{ jobs.pack.outputs.path }}

jobs:
pack:
runs-on: ubuntu-latest
outputs:
name: ${{ steps.build.outputs.name }}
source: ${{ steps.detect-source.outputs.type }}
tarball: ${{ steps.tgz.outputs.path }}
artifact: ${{ steps.build.outputs.name }}
path: ${{ steps.result.outputs.path }}

steps:
- name: Detect source type
id: detect-source
Expand All @@ -51,6 +49,11 @@ jobs:
run: |
echo "Source: ${{ steps.detect-source.outputs.type }}"
- name: Check NPM Package Version
if: steps.detect-source.outputs.type == 'npm'
run: |
npm show ${{ inputs.package }} version || exit
- name: Extract repo and branch
if: steps.detect-source.outputs.type == 'github'
id: repo
Expand Down Expand Up @@ -97,3 +100,9 @@ jobs:
if: steps.detect-source.outputs.type == 'github'
run: |
echo "${{ steps.tgz.outputs.path }}"
- name: Output path
id: result
run: |
echo "path=${{ steps.detect-source.outputs.type == 'github' && steps.tgz.outputs.path || inputs.package }}" >> "$GITHUB_OUTPUT"

0 comments on commit d8a1212

Please sign in to comment.