-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move publishing dev releases to its own pipeline (#388)
- Loading branch information
1 parent
5ec7293
commit fb7ea77
Showing
2 changed files
with
90 additions
and
10 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
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,90 @@ | ||
trigger: none | ||
pr: none | ||
|
||
variables: | ||
NodeVersion: '12.x' | ||
goTestPath: '$(system.defaultWorkingDirectory)/test' | ||
GOBIN: '$(system.defaultWorkingDirectory)/bin/go' | ||
|
||
jobs: | ||
- job: 'AutoRest_Go_Dev_Release' | ||
displayName: 'Publish Dev Release' | ||
|
||
strategy: | ||
matrix: | ||
Linux_Go113: | ||
vm.image: 'ubuntu-18.04' | ||
go.version: '1.13' | ||
GOROOT: '/usr/local/go$(go.version)' | ||
Linux_Go114: | ||
vm.image: 'ubuntu-18.04' | ||
go.version: '1.14' | ||
GOROOT: '/usr/local/go$(go.version)' | ||
|
||
pool: | ||
vmImage: '$(vm.image)' | ||
|
||
steps: | ||
- task: NodeTool@0 | ||
displayName: 'Install Node $(NodeVersion)' | ||
inputs: | ||
versionSpec: '$(NodeVersion)' | ||
|
||
- script: | | ||
cd $(Build.SourcesDirectory) | ||
npm install -g "@microsoft/rush" | ||
rush update --debug | ||
npm install -g autorest | ||
displayName: 'Prepare Generator Environment' | ||
- script: | | ||
rush rebuild -v | ||
displayName: 'Build Generator Sources' | ||
- script: | | ||
rush regenerate | ||
git add -A ./test/. | ||
git diff --staged -w 1>&2 | ||
displayName: 'Regenerate Autorest Tests' | ||
failOnStderr: true | ||
- script: | | ||
set -e | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
displayName: 'Create Go Workspace' | ||
- script: | | ||
set -e | ||
go version | ||
go get github.com/jstemmer/go-junit-report | ||
displayName: 'Install Dependencies' | ||
workingDirectory: '$(goTestPath)' | ||
- script: go vet $(go list ./...) | ||
displayName: 'Vet' | ||
workingDirectory: '$(goTestPath)' | ||
|
||
- script: | | ||
pushd ../src/node_modules/@microsoft.azure/autorest.testserver | ||
npm start& | ||
popd | ||
go test -v ./... 2>&1 | $(GOBIN)/go-junit-report > report.xml | ||
go run ./autorest/covreport/main.go | ||
pushd ../src/node_modules/@microsoft.azure/autorest.testserver | ||
npm stop | ||
displayName: 'Run Acceptance Tests' | ||
workingDirectory: '$(goTestPath)' | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testRunner: JUnit | ||
testResultsFiles: $(goTestPath)/report.xml | ||
failTaskOnFailedTests: true | ||
|
||
- pwsh: | | ||
$currentVersion = node -p -e "require('./src/package.json').version"; | ||
$currentVersion="$currentVersion-$(Build.BuildNumber)"; | ||
cd src | ||
npm version --no-git-tag-version $currentVersion | ||
npm pack; | ||
npx publish-release --token $(package-write-token) --repo autorest.go --owner azure --name "Autorest for Go v$currentVersion" --tag v$currentVersion --notes='Preview version of Autorest for Go track 2' --prerelease --editRelease false --assets autorest-go-$currentVersion.tgz --target_commitish $(Build.SourceBranchName); | ||
displayName: 'Publish Dev Release' |