Skip to content

Commit

Permalink
ci: update pipeline build commands for next / latest release (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonoh authored Oct 29, 2019
1 parent 540d6cc commit 91a670b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 65 deletions.
59 changes: 0 additions & 59 deletions .azure-pipelines-next.yml

This file was deleted.

37 changes: 33 additions & 4 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
trigger:
- master
branches:
include:
- master
tags:
include:
- latest

jobs:
- job: Release
condition: eq(variables['Build.SourceBranch'], 'refs/tags/latest')
pool:
vmImage: ubuntu-16.04
steps:
- template: .azure-pipelines-steps.yml
- bash: |
echo "##vso[task.setvariable variable=PACKAGE_VERSION]$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')"
echo "##vso[task.setvariable variable=CURRENT_GIT_TAG]$(git describe --tags | tr -d '[:space:]')"
- script: npm dist-tag add aws-spot-price@$(PACKAGE_VERSION) $(CURRENT_GIT_TAG)
displayName: "NPM dist-tag $(CURRENT_GIT_TAG)"
env:
NPM_TOKEN: $(NPM_TOKEN)

- job: Linux
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/'), startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
pool:
vmImage: ubuntu-16.04
strategy:
Expand All @@ -24,15 +44,23 @@ jobs:
organization: "hoonoh"
scannerMode: "CLI"
configMode: "file"
condition: and(succeeded(), eq(variables['node_version'], '10.x'))
condition: eq(variables['node_version'], '10.x')
- task: SonarCloudAnalyze@1
condition: and(succeeded(), eq(variables['node_version'], '10.x'))
condition: eq(variables['node_version'], '10.x')
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: "300"
condition: and(succeeded(), eq(variables['node_version'], '10.x'))
condition: eq(variables['node_version'], '10.x')
# semantic-release run only on node 10.x & master branch (releases to next dist-tag)
- script: yarn semantic-release || true
displayName: Release
condition: and(eq(variables['node_version'], '10.x'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
env:
NPM_TOKEN: $(NPM_TOKEN)
GH_TOKEN: $(GH_TOKEN)

- job: Windows
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/'), startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
pool:
vmImage: vs2017-win2016
strategy:
Expand All @@ -51,6 +79,7 @@ jobs:
- template: .azure-pipelines-steps.yml

- job: macOS
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/'), startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
pool:
vmImage: macos-10.13
strategy:
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
]
},
"release": {
"branch": "next",
"branch": "master",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand All @@ -85,11 +85,14 @@
"package.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
"message": "chore(next): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
},
"publishConfig": {
"tag": "next"
},
"dependencies": {
"aws-sdk": "^2.544.0",
"ora": "^4.0.2",
Expand Down

0 comments on commit 91a670b

Please sign in to comment.