-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
53 lines (45 loc) · 1.47 KB
/
azure-pipelines.yml
File metadata and controls
53 lines (45 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
trigger:
branches:
include:
- main
- develop
name: $(Date:yyyyMMdd)$(Rev:rrr)
pool:
vmImage: "ubuntu-latest"
variables:
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/develop') }}:
GRAPHQL_SCHEMA_URL: "https://data-scus-dev.graphlit.io/api/v1/graphql"
NPM_VERSION_SUFFIX: "-dev"
NPM_TAG: "dev"
${{ else }}:
GRAPHQL_SCHEMA_URL: "https://data-scus.graphlit.io/api/v1/graphql"
NPM_VERSION_SUFFIX: ""
NPM_TAG: "latest"
steps:
- task: NodeTool@0
inputs:
versionSpec: "20.x"
displayName: "Install Node.js"
- script: |
npm install
npm run generate
npm run build
npm version 1.0.$(Build.BuildNumber)$(NPM_VERSION_SUFFIX) --no-git-tag-version --allow-same-version
displayName: "Install dependencies and build"
- task: CopyFiles@2
inputs:
SourceFolder: "$(Build.SourcesDirectory)"
Contents: "README.md"
TargetFolder: "$(Build.ArtifactStagingDirectory)/dist"
- task: CopyFiles@2
inputs:
SourceFolder: "$(Build.SourcesDirectory)"
Contents: "LICENSE"
TargetFolder: "$(Build.ArtifactStagingDirectory)/dist"
- task: Npm@1
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/develop')))
inputs:
command: publish
publishRegistry: useExternalRegistry
publishEndpoint: "NPM"
publishTag: "$(NPM_TAG)"