From c372b3070c788c6264446a90461732801599d750 Mon Sep 17 00:00:00 2001 From: Daniel Del Core Date: Thu, 1 Apr 2021 23:11:31 +1100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Create=20release=20codemod=20workfl?= =?UTF-8?q?ow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-codmods.yml | 27 +++++++++++++++++++++++++++ .github/workflows/test.yml | 1 - packages/publisher/src/index.ts | 2 +- packages/publisher/src/publish.ts | 1 - 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release-codmods.yml diff --git a/.github/workflows/release-codmods.yml b/.github/workflows/release-codmods.yml new file mode 100644 index 000000000..9b83bd00a --- /dev/null +++ b/.github/workflows/release-codmods.yml @@ -0,0 +1,27 @@ +name: Release Codemods + +on: + push: + branches: [master] + +jobs: + release: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn install --frozen-lockfile + - run: yarn validate + - run: yarn test + - run: yarn release:codemods + env: + CI: true + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95647f7c6..fdffa6acb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,6 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - run: npm install -g yarn - run: yarn install --frozen-lockfile - run: yarn test env: diff --git a/packages/publisher/src/index.ts b/packages/publisher/src/index.ts index 026b6e617..f49bedaba 100644 --- a/packages/publisher/src/index.ts +++ b/packages/publisher/src/index.ts @@ -18,7 +18,7 @@ async function main(sinceRef: string, sourcePath: string, targetPath: string) { await buildPackages(); console.log('Publishing changed packages'); - await publishPackages(targetPath, process.env.GITHUB_TOKEN!); + await publishPackages(targetPath, process.env.NPM_TOKEN!); console.log('Cleaning up temporary directory'); cleanTargetDir(targetPath); diff --git a/packages/publisher/src/publish.ts b/packages/publisher/src/publish.ts index 0c18b4a6c..83783ca79 100644 --- a/packages/publisher/src/publish.ts +++ b/packages/publisher/src/publish.ts @@ -22,7 +22,6 @@ function publishPackage( return new Promise((resolve, reject) => client.publish( npmUri, - // npmUri + packageName, { metadata, access,