Skip to content

Commit

Permalink
chore(Root): check pr workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kikoruiz committed Jan 22, 2024
1 parent f142e81 commit 9f2c30c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,18 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }}
GITHUB_USER: sui-bot
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-tagged-packages:
name: Publish Tagged Packages to NPM
if: github.ref != 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Get Files
id: files
uses: jitterbit/get-changed-files@v1
with:
format: 'json'

- name: Publish Packages
working-directory: ${{ github.workspace }}
run: publish-tagged-packages '${{ steps.files.outputs.added_modified }}'
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"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 @@ -34,6 +37,7 @@
"@s-ui/precommit": "3",
"@s-ui/react-context": "1",
"chai": "4.3.6",
"commander": "11.1.0",
"react": "17",
"sinon": "10.0.0",
"typescript": "5.0.4",
Expand Down
21 changes: 21 additions & 0 deletions scripts/publish-tagged-packages.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node

const program = require('commander')

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

const {files} = program.opts()

console.log({files})

program.exit(0)

0 comments on commit 9f2c30c

Please sign in to comment.