forked from stashenergy/react-native-msal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: scope the package under private registry
- Loading branch information
1 parent
14ecbf8
commit b9b57c0
Showing
4 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
trigger: | ||
- nbt-prod | ||
|
||
pool: | ||
vmImage: "macOS-12" | ||
|
||
variables: | ||
- name: nodeVersion | ||
value: "14.19.0" | ||
- group: "NbtRegistry" | ||
|
||
stages: | ||
- stage: BuildJs | ||
displayName: BuildJs | ||
jobs: | ||
- job: Build | ||
steps: | ||
- checkout: self | ||
persistCredentials: true | ||
clean: true | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: $(nodeVersion) | ||
displayName: "Install Node" | ||
|
||
- task: Cache@2 | ||
inputs: | ||
key: 'node | "$(Agent.OS)" | yarn.lock' | ||
restoreKeys: | | ||
node | "$(Agent.OS)" | ||
path: node_modules | ||
displayName: Cache node modules | ||
|
||
- script: | | ||
yarn install --network-concurrency 1 | ||
displayName: "Install node modules" | ||
- script: | | ||
yarn lint | ||
displayName: "Lint" | ||
- script: | | ||
yarn test --passWithNoTests | ||
displayName: "Unit tests Typescript" | ||
- script: | | ||
yarn audit || echo "Has Open source vulnerabilities" | ||
displayName: "Open source vulnerabilities" | ||
- stage: Publish | ||
displayName: Publish package | ||
condition: | | ||
and | ||
( | ||
or | ||
( | ||
eq(variables['Build.Reason'], 'IndividualCI'), | ||
eq(variables['Build.Reason'], 'Manual') | ||
), | ||
eq(variables['Build.SourceBranch'], 'refs/heads/master'), | ||
succeeded('BuildJs') | ||
) | ||
jobs: | ||
- job: Publish | ||
steps: | ||
- checkout: self | ||
persistCredentials: true | ||
clean: true | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: $(nodeVersion) | ||
displayName: "Install Node" | ||
|
||
- task: Cache@2 | ||
inputs: | ||
key: 'node | "$(Agent.OS)" | yarn.lock' | ||
restoreKeys: | | ||
node | "$(Agent.OS)" | ||
path: node_modules | ||
displayName: Cache node modules | ||
|
||
- script: ./scripts/prepare-npmrc.sh | ||
displayName: "Prepare .npmrc" | ||
env: | ||
PRIVATE_REGISTRY_URL: $(nbtPrivateRegistryUrl) | ||
- task: npmAuthenticate@0 | ||
inputs: | ||
workingFile: .npmrc | ||
|
||
- script: | | ||
yarn install --network-concurrency 1 | ||
displayName: "Install node modules" | ||
- script: npm publish | ||
displayName: "Publish package" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
cat <<EOF > .npmrc | ||
registry=https://registry.npmjs.org/ | ||
@nbt-private:registry=https://${PRIVATE_REGISTRY_URL}/npm/registry/ | ||
always-auth=true | ||
EOF |