diff --git a/eng/pipelines/ci.yml b/eng/pipelines/ci.yml index 38f294678..4964cfc45 100644 --- a/eng/pipelines/ci.yml +++ b/eng/pipelines/ci.yml @@ -94,13 +94,3 @@ jobs: cd src/node_modules/@microsoft.azure/autorest.testserver; npm run coverage-push -- $(Build.Repository.Name) $(Build.SourceBranch) $(github-token) $(storage-coverage-user) $(storage-coverage-pass) $currentVersion; displayName: 'Publish AutoRest Test Server Coverage Report' - - - ${{if ne(variables['Build.Reason'], 'PullRequest')}}: - - 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' diff --git a/eng/pipelines/publish-dev-release.yml b/eng/pipelines/publish-dev-release.yml new file mode 100644 index 000000000..4dc113272 --- /dev/null +++ b/eng/pipelines/publish-dev-release.yml @@ -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'