-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,19 +59,17 @@ 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: yarn cs publish --tag alpha --no-git-tag --dry-run | ||
run: '"PUBLISHED_PACKAGES=$(yarn ts-node publish.ts)" >> "$GITHUB_OUTPUT"' | ||
# Publishing "@celo/phone-number-privacy-common" at "3.0.4-alpha-964a99345" | ||
# id like to take all lines like the above and create an array of packages with form | ||
# ["@celo/[email protected]"] | ||
outputs: | ||
# output array of packages like ["@celo/[email protected]"] | ||
packages: ${{ steps.versioning.outputs }} | ||
status: no-op | success | ||
packages: ${{ steps.versioning.outputs.PUBLISHED_PACKAGES }} | ||
install: | ||
name: Install Snapshot Releases | ||
needs: ['release'] | ||
# if any packages where published install them else report success | ||
# if: ${{needs.release.outputs.status == 'success'}} | ||
runs-on: ['self-hosted', 'org', 'npm-publish'] | ||
steps: | ||
# for each package call npm install package@version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as child_process from 'child_process' | ||
|
||
const FAKE_OUTPUT = ` | ||
🦋 info npm info @celo/phone-number-privacy-common | ||
🦋 info npm info @celo/encrypted-backup | ||
🦋 info npm info @celo/identity | ||
🦋 info @celo/phone-number-privacy-common is being published because our local version (3.0.4-alpha-964a99345) has not been published on npm | ||
🦋 warn @celo/encrypted-backup is not being published because version 5.0.4 is already published on npm | ||
🦋 warn @celo/identity is not being published because version 5.0.4 is already published on npm | ||
🦋 info Publishing "@celo/phone-number-privacy-common" at "3.0.4-alpha-964a99345" | ||
🦋 info Publishing "@celo/identity-common" at "3.0.4-alpha-964a99345" | ||
` | ||
// publish packages as alpha and return the list of packages published | ||
function publish() { | ||
// const snapshot = child_process.execSync('yarn cs publish --tag alpha --no-git-tag') | ||
const snapshot = child_process.execSync(`echo "${FAKE_OUTPUT}"`) | ||
const arrayOfLines = snapshot.toString().split('\n').map((line: string) => { | ||
const matches = line.match(/info Publishing @celo.*$/) | ||
return matches | ||
}) | ||
|
||
|
||
const pkgs = arrayOfLines.filter(line => !!line).map((line) => { | ||
if (!line) return | ||
return line[0].replace('info Publishing ', '').replace(' at ', '@') | ||
}).join(',') | ||
|
||
console.log(pkgs) | ||
return pkgs | ||
} | ||
|
||
publish() |