From a0d6030b93aeb4b460c373afb253a3b6b175543d Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 23 Oct 2023 15:12:23 +0200 Subject: [PATCH] enter the matrix --- .github/workflows/prerelease.yml | 14 ++++++++++---- publish.ts | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index ad69e021c..099fbcda5 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -60,7 +60,7 @@ jobs: # when there are version changes "All files have been updated. Review them and commit at your leisure" # when there are no version changes "No unreleased changesets found, exiting" - name: Publish packages - run: echo PUBLISHED_PACKAGES=$(yarn ts-node publish.ts) >> $GITHUB_OUTPUT + run: echo PUBLISHED_PACKAGES=$(yarn --silent ts-node publish.ts) >> $GITHUB_OUTPUT id: 'publishing' - name: View output run: echo ${{ steps.publishing.outputs.PUBLISHED_PACKAGES }} @@ -75,8 +75,14 @@ jobs: name: Install Snapshot Releases needs: ['release'] # if any packages where published install them else report success - runs-on: ['self-hosted', 'org', 'npm-publish'] + if: ${{ needs.release.outputs.packages != 'no-op' }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + packages: ${{ fromJson(needs.release.outputs.packages) }} steps: # for each package call npm install package@version - # possibly use a matrix - - run: echo ${{needs.release.outputs.example}} -- ${{needs.release.outputs.packages}} \ No newline at end of file + - name: Install ${{ matrix.package }} + run: npm install ${{ matrix.package }} + diff --git a/publish.ts b/publish.ts index 4dbf43cea..fd37088b0 100644 --- a/publish.ts +++ b/publish.ts @@ -23,8 +23,8 @@ function publish() { const pkgs = arrayOfLines.filter(line => !!line).map((line) => { if (!line) return return line[0].replace('info Publishing ', '').replace(' at ', '@') - }).join(',') - const result = pkgs ? pkgs : 'no-op' + }) + const result = pkgs ? JSON.stringify(pkgs) : 'no-op' process.stdout.write(result) }