Skip to content

openupm/openupm-pipelines

Repository files navigation

Azure Pipelines for OpenUPM

A customized proxy builder to build and publish upm package using Azure Pipelines.

Prepare Azura

Prepare a service connection

  • Visit https://dev.azure.com/openupm/openupm
  • Project settings > Service connections > New service connection > npm
  • Connection name, openupm
  • Registry URL, https://package.openupm.com
  • Personal Token...

Build with REST API

Required variables

{
    repo_url: 'https://...',
    repo_branch: 'master',
    package_name: 'com.yourcompany.package...'
}

If no variables are provided, the build will be abort as failed.

Api reference: azure-devops-rest-5.1.

http --ignore-stdin \
  -v \
  -a username:token \
  post https://dev.azure.com/openupm/openupm/_apis/build/builds?api-version=5.1 \
  definition:='{ "id": 1 }' \
  parameters:='"{ \"repo_url\": \"https://...\", ... }"'

The parameters argument is a stringified dictionary.

Build with azure-devops-node-api

https://github.com/Microsoft/azure-devops-node-api

const azureDevops = require("azure-devops-node-api");

const token = '';
const endpoint = 'https://dev.azure.com/openupm';
const definitionId = 1;
const project = 'openupm';

const buildPipelines = async function () {
  let authHandler = azureDevops.getPersonalAccessTokenHandler(token);
  let conn = new azureDevops.WebApi(endpoint, authHandler);
  var buildApi = await conn.getBuildApi();
  let build = await buildApi.queueBuild({
    definition: {
      id: definitionId
    },
    parameters:
      JSON.stringify(
        {
          repo_url: 'https://...',
          ...
        }
      )
  }, project);
  cconsole.log(build);
};

Contributors

Favo Yang
Favo Yang

💻 🚧
Pavel
Pavel "am1goo" Shestakov

💻
James Frowen
James Frowen

🐛

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •