Skip to content

Commit

Permalink
enter the matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmgdr committed Oct 23, 2023
1 parent 5e4cc26 commit a0d6030
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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}}
- name: Install ${{ matrix.package }}
run: npm install ${{ matrix.package }}

4 changes: 2 additions & 2 deletions publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit a0d6030

Please sign in to comment.