Skip to content

Commit

Permalink
fix: npmrc configuration for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
kpanot committed Jan 27, 2023
1 parent 5111383 commit 67239b0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
is-prerelease: ${{ inputs.prerelease || (github.event.release && github.event.release.prerelease) }}
version: ${{ steps.get-version.outputs.version }}
- name: Publish
run: yarn run publish --tag=${{ github.event_name == 'pull_request' && 'pr' || steps.get-npm-tag.outputs.tag }} ${{ github.event_name == 'pull_request' && '--userconfig=./.npmrc.pr' || ''}}
run: yarn run publish --tag=${{ github.event_name == 'pull_request' && 'pr' || steps.get-npm-tag.outputs.tag }} ${{ github.event_name == 'pull_request' && '--userconfig=./.npmrc.pr' || ''}} --always-auth=true
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"setup:generators": "yarn artifact-retriever --repository-manager \"Azure Artifacts\" --organization AmadeusDigitalAirline --project DES-SDKs --feed des-sdks -u \"AmadeusDigitalAirline\" -g \"io.swagger\" -a \"swagger-codegen-cli\" -v \"2.4.0-AMADEUS\" --out ./packages/@ama-sdk/generator-sdk/src/generators/resources/swagger-codegen-cli.jar || true",
"build:storybook": "yarn doc:generate:json && yarn ng run storybook:extract-style && build-storybook",
"clear": "rimraf './{packages,tools,apps}/@*/{amaterasu/,}*/{dist,build}/'",
"set:version": "yarn set-version --placeholder 0.0.0-placeholder",
"set:version": "yarn set-version --placeholder 0.0.0-placeholder --include '{apps,packages}/**/dist/package.json'",
"doc:generate": "rimraf ./generated-doc && yarn doc:summary-update && yarn compodoc && node ./scripts/doc-links.js",
"doc:generate:json": "yarn doc:summary-update && yarn compodoc -e json -d .",
"doc:summary-update": "node scripts/update-doc-summary.js",
Expand Down
7 changes: 6 additions & 1 deletion packages/@o3r/dev-tools/src/cli/set-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import * as fs from 'node:fs';
import * as path from 'node:path';
import * as winston from 'winston';

const defaultIncludedFiles = ['**/package.json', '!/**/templates/**/package.json', '!**/node_modules/**/package.json'];

const collect = (pattern: string, patterns: string[]) => {
if (patterns === defaultIncludedFiles && pattern) {
patterns = [];
}
patterns.push(pattern);
return patterns;
};
Expand All @@ -16,7 +21,7 @@ program
.arguments('<version>')
.description('Replace the packages version in a monorepos')
.option('-p, --placeholder <placeholder>', 'Pattern of the version placeholder', '0.0.0(-placeholder)?')
.option('--include <file>', 'Add files pattern to apply the version replacement', collect, ['*/lerna.json', '**/package.json', '!**/node_modules/**/{package,lerna}.json'])
.option('--include <file>', 'Add files pattern to apply the version replacement', collect, defaultIncludedFiles)
.option('-v, --verbose', 'Display debug logs')
.action((version: string) => {
replaceVersion = version;
Expand Down

0 comments on commit 67239b0

Please sign in to comment.