Skip to content

Commit

Permalink
Fix NPM release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed May 27, 2020
1 parent 17be438 commit af24f95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -23,9 +23,11 @@ jobs:
- name: Use Node
uses: actions/setup-node@v1
with:
# Setup .npmrc file to publish to npm
node-version: '14.x'
registry-url: 'https://registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}'
- name: Setup NPM credentials
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
7 changes: 2 additions & 5 deletions scripts/release.js
Expand Up @@ -6,9 +6,6 @@ const semver = require('semver');
const cp = require('child_process');
const rootPackageJson = require('../package.json');
const { cwd } = require('process');
const pLimit = require('p-limit');

const useLimit = pLimit(3);

async function release() {

Expand All @@ -34,7 +31,7 @@ async function release() {

rootPackageJson.version = version;
await writeFile(resolve(__dirname, '../package.json'), JSON.stringify(rootPackageJson, null, 2));
await Promise.all(packageJsonPaths.map(packageJsonPath => useLimit(async () => {
await Promise.all(packageJsonPaths.map(async packageJsonPath => {
const packageJson = require(packageJsonPath);
packageJson.version = version;
for (const dependency in packageJson.dependencies) {
Expand Down Expand Up @@ -80,7 +77,7 @@ async function release() {
});
});
}
})));
}))
console.info(`Released successfully!`);
console.info(`${tag} => ${version}`);
}
Expand Down

0 comments on commit af24f95

Please sign in to comment.