File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish NPM packages
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : " Package version number"
8+ wix-velo/external-db-airtable :
9+ type : boolean
10+ description : " @wix-velo/external-db-airtable"
11+ default : true
12+
13+ wix-velo/external-db-bigquery :
14+ type : boolean
15+ description : " @wix-velo/external-db-bigquery"
16+ default : true
17+
18+ jobs :
19+ publish_npm_ackage :
20+
21+ runs-on : ubuntu-latest
22+ env :
23+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
24+
25+ steps :
26+ - name : Git checkout
27+ uses : actions/checkout@v3
28+
29+ - uses : actions/setup-node@v3
30+ with :
31+ node-version : ' 16.x'
32+ registry-url : ' https://registry.npmjs.org'
33+
34+ - uses : actions/github-script@v6
35+ with :
36+ script : |
37+ const script = require('.github/workflows/script.js')
38+ await script({github, context, core})
39+
40+
41+
42+ - run : npm ci
43+
44+ - name : Tag and push the image to Amazon ECR
45+ run : |
46+ cd packages/external-db-airtable
47+ npm publish --dry-run
48+
49+
Original file line number Diff line number Diff line change 1+ module . exports = async ( { github, context, core} ) => {
2+ const execSync = require ( 'child_process' ) . execSync
3+
4+ const { version } = context . payload . inputs
5+ delete context . payload . inputs
6+
7+ execSync ( "pwd" )
8+
9+ console . log ( { version } )
10+
11+ for ( const [ key , value ] of Object . entries ( context . payload ) ) {
12+ console . log ( `${ key } : ${ value } ` ) ;
13+ }
14+
15+ // const eventInputs = Object.keys(inputs)
16+ // const packageNames = eventInputs.filter(i => i != "version")
17+ // console.log(packageNames);
18+ // console.log(eventInputs[0]);
19+ // execSync("pwd")
20+ // console.log(context)
21+ // console.log(github)
22+ }
You can’t perform that action at this time.
0 commit comments