Skip to content

Commit

Permalink
chore(Root): change script execution
Browse files Browse the repository at this point in the history
  • Loading branch information
kikoruiz committed Jan 22, 2024
1 parent d7fdf6a commit 71fcce1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,4 @@ jobs:
format: 'json'

- name: Publish Packages
working-directory: ${{ github.workspace }}
run: node ./scripts/publish-tagged-packages.mjs --tag '${{ github.ref }}' --files '${{ steps.files.outputs.added_modified }}'
run: npm run publish-tagged-packages --tag '${{ github.ref_name }}' --files '${{ steps.files.outputs.added_modified }}'
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"workspaces": [
"packages/*"
],
"bin": {
"publish-tagged-packages": "./scripts/publish-tagged-packages.mjs"
},
"scripts": {
"phoenix": "npx @s-ui/mono phoenix && npx -y ultra-runner --raw --recursive prepublishOnly --build &>/dev/null",
"co": "npx @s-ui/mono commit",
Expand All @@ -28,6 +25,7 @@
"test:e2e": "node ./packages/sui-studio/test/server/integration/static-server.js ./packages/sui-studio/test/server/integration/sample-studio/public && npx @s-ui/test-e2e --baseUrl=http://localhost:1234",
"pre-commit": "sui-lint js --staged && sui-lint sass --staged",
"pre-push": "npm run test && npm run types:check",
"publish-tagged-packages": "node ./scripts/publish-tagged-packages.js",
"commit-msg": "validate-commit-msg",
"types:check": "tsc"
},
Expand Down
26 changes: 26 additions & 0 deletions scripts/publish-tagged-packages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env node
const program = require('commander')

program
.name('publish-tagged-packages')
.description('CLI to publish new tagged versions from modified packages in pull requests.')
.version('0.0.1')

program
.option('-t, --tag [tag]', 'Tag used to publish the packages to NPM.')
.option('-f, --files [files]', 'JSON-stringified list of added and modified files.')
.on('--help', () => {
console.log(' Examples:')
console.log('')
console.log(
' $ node ./scripts/publish-tagged-packages.js --tag ongoing-branch --files \'["packages/sui-mono/foo.js", "packages/sui-bundler/bar.js"]\''
)
console.log('')
})
.parse(process.argv)

const {tag, files} = program.opts()

console.log({tag, files: JSON.parse(files)})

program.parse()
21 changes: 0 additions & 21 deletions scripts/publish-tagged-packages.mjs

This file was deleted.

0 comments on commit 71fcce1

Please sign in to comment.