Skip to content

Instantly share code, notes, and snippets.

@usrrname
Created May 11, 2022 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usrrname/d674910fbac574d8dcb5fc424d6e11ec to your computer and use it in GitHub Desktop.
Save usrrname/d674910fbac574d8dcb5fc424d6e11ec to your computer and use it in GitHub Desktop.
trigger:
- main
- feature/R20-22-azure-piplines
variables:
- group: radius-angular
- name: projectName
value: $[variables.PROJECT_NAME]
- name: feedName
value: $[variables.FEED_NAME]
- name: personalAccessToken
value: $[variables.PERSONAL_ACCESS_TOKEN]
- name: orgName
value: $[variables.ORG_NAME]
- name: GitHubToken
value: $[variables.GH_TOKEN]
- name: npm_config_cache
value: $(Pipeline.Workspace)/.npm
jobs:
- job: install
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
displayName: "Install Node"
# requires package-lock.json
- task: Cache@2
displayName: "Cache npm packages"
inputs:
key: 'npm | "$(Agent.OS)" | package-lock.json'
restoreKeys: |
npm | "$(Agent.OS)"
path: $(npm_config_cache)
- task: Bash@3
displayName: "Show cache"
inputs:
targetType: "inline"
script: |
npm cache ls
npm cache verify
- job: build
pool:
vmImage: ubuntu-latest
dependsOn: install
steps:
- task: Bash@3
displayName: "Cache exists - Clean install and lint"
inputs:
targetType: "inline"
script: |
npm ci --cache $(npm_config_cache)
npm run lint
condition: ne(variables.CACHE_RESTORED, 'true')
- script: npm run test:ds --collect-coverage
displayName: "Test"
- script: npm run build:ds
displayName: "Build design system package"
- bash: cd dist && npm pack
displayName: "Package for npm release"
- publish: $(System.DefaultWorkingDirectory)/npm
displayName: "Publish built package artifacts"
artifact: package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment