Skip to content

Commit

Permalink
nop
Browse files Browse the repository at this point in the history
  • Loading branch information
MXPOL committed Jun 7, 2022
1 parent eb0abfc commit 8ff9119
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish NPM packages

on:
workflow_dispatch:
inputs:
version:
description: "Package version number"
wix-velo/external-db-airtable:
type: boolean
description: "@wix-velo/external-db-airtable"
default: true

wix-velo/external-db-bigquery:
type: boolean
description: "@wix-velo/external-db-bigquery"
default: true

jobs:
publish_npm_ackage:

runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

steps:
- name: Git checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- uses: actions/github-script@v6
with:
script: |
const script = require('.github/workflows/script.js')
await script({github, context, core})
- run: npm ci

- name: Tag and push the image to Amazon ECR
run: |
cd packages/external-db-airtable
npm publish --dry-run
24 changes: 24 additions & 0 deletions .github/workflows/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = async ({github, context, core}) => {
const execSync = require('child_process').execSync

const { version } = context.payload.inputs
delete context.payload.inputs.version

execSync(`pwd`, {
encoding: "utf8"
})

console.log({ version })

for (const [key, value] of Object.entries(context.payload)) {
console.log(`${key}: ${value}`);
}

// const eventInputs = Object.keys(inputs)
// const packageNames = eventInputs.filter(i => i != "version")
// console.log(packageNames);
// console.log(eventInputs[0]);
// execSync("pwd")
// console.log(context)
// console.log(github)
}

0 comments on commit 8ff9119

Please sign in to comment.