From 1e54a60fb35c4f8efe5fc52a9cc24abacea0697e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=BCbner?= <25882725+shuebner20@users.noreply.github.com> Date: Sun, 25 Jul 2021 15:14:10 +0200 Subject: [PATCH] add Azure DevOps CI build --- azure-pipelines.yml | 80 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..c85ae6c --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,80 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +trigger: +- master + +pool: + vmImage: ubuntu-latest + +variables: + libraryCounter: 'TypedocPluginDevopsSourceFileTS_$(Davisol.TypedocPluginDevopsSourceFileTsMajorMinorVersion)' + libraryBuildRevision: $[counter(variables['libraryCounter'], 200)] + libraryBuildVersion: '$(Davisol.TypedocPluginDevopsSourceFileTsMajorMinorVersion).$(libraryBuildRevision)' + +name: 'TypedocPluginDevopsSourceFile_TS_v$(Davisol.TypedocPluginDevopsSourceFileTsMajorMinorVersion).$(libraryBuildRevision)$(Rev:.r)' + +steps: +- task: NodeTool@0 + inputs: + versionSpec: '14.x' + displayName: 'Install Node.js' + +- script: | + npm install + displayName: 'npm install' + +- script: | + npm version patch -m 'Bump version to %s' + displayName: 'npm bump version' + +- script: | + npm install + displayName: 'npm build' + +- script: | + git push + displayName: 'push bumped version to origin repo' + +- task: CopyFiles@2 + inputs: + SourceFolder: '$(System.DefaultWorkingDirectory)' + Contents: | + package.json + **.md + TargetFolder: '$(System.DefaultWorkingDirectory)/dist' + OverWrite: true + displayName: 'copy static files to output directory' + + + +- task: CopyFiles@2 + inputs: + SourceFolder: '$(System.DefaultWorkingDirectory)/dist' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)' + OverWrite: true + displayName: 'deploy output directory contents to artifact stage' + +- task: GitHubRelease@1 + inputs: + gitHubConnection: 'github.com_shuebner20' + repositoryName: '$(Build.Repository.Name)' + action: 'create' + target: '$(Build.SourceVersion)' + tagSource: 'gitTag' + releaseNotesSource: 'inline' + isDraft: true + changeLogCompareToRelease: 'lastFullRelease' + changeLogType: 'commitBased' + displayName: 'create release at GitHub' + +- task: Npm@1 + inputs: + command: 'publish' + workingDir: '$(System.DefaultWorkingDirectory)/dist' + publishRegistry: 'useFeed' + publishFeed: '2ecdc2b4-96cd-42e2-b46d-52fd45177053/56115eca-361e-4c4a-a490-94c430a57cb7' + enabled: false \ No newline at end of file