Skip to content

Commit

Permalink
build: fix loading packages with slash (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey28 authored Aug 9, 2023
1 parent c9f4f09 commit 166ba12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions actions/detect-package-metadata/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: "Detect build scripts"
outputs:
name:
value: ${{ steps.detect_scripts.outputs.name }}
pack-name:
value: ${{ steps.detect_scripts.outputs.pack-name }}
version:
value: ${{ steps.detect_scripts.outputs.version }}
scripts:
Expand All @@ -29,6 +31,7 @@ runs:
const packageInfo = require(packageInfoPath);
core.setOutput('name', packageInfo.name);
core.setOutput('pack-name', packageInfo.name.replace(/\//g, '-'));
core.setOutput('version', packageInfo.version);
core.setOutput('scripts', Object.keys(packageInfo.scripts).filter(script => script.startsWith('build')))
Expand Down
4 changes: 2 additions & 2 deletions actions/load-artifacts-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ runs:
name: npm

- shell: bash
run: tar --strip-components=1 -xzf '${{ format('.builds/{0}-{1}.tgz', steps.detect-package-metadata.outputs.name, steps.detect-package-metadata.outputs.version) }}'
run: tar --strip-components=1 -xzf '${{ format('.builds/{0}-{1}.tgz', steps.detect-package-metadata.outputs.pack-name, steps.detect-package-metadata.outputs.version) }}'

- uses: actions/github-script@v6
with:
script: |
const workspaces = JSON.parse(${{ toJSON(steps.detect-package-metadata.outputs.workspaces) }});
for (const workspace of workspaces)
await exec.exec(`tar --strip-components=1 -C ${workspace.path} -xzf .builds/${workspace.name.replace(/\//g, '-')}-${workspace.version}.tgz`)
await exec.exec(`tar --strip-components=1 -C ${workspace.path} -xzf .builds/${workspace.name}-${workspace.version}.tgz`)

0 comments on commit 166ba12

Please sign in to comment.