Skip to content

Commit 52b0db4

Browse files
committed
azure-pipelines-task: add an Azure Pipelines task
Introduce a new sub-package that is an Azure Pipelines task, that wraps the logic from the GitHub action. Most of the @actions/core functions have 1:1 equivalents in Azure Pipelines, so we can easily port the action logic into an Azure task instead. @actions/cache doesn't have the same integration, but consumers can use the Cache@2 task directly in their pipeline YAML instead. Note that due to difference in the task/action definition schema, some of the input names cannot be exactly the same. Namely the `github-token` action input is not a valid task input, due to the '-'. We maintain a mapping of GitHub Actions -> Azure Pipelines input names and do the translation in our ICore implemention. Running `npm run build` followed by `npm run package` will use `ncc` to compile all the task code into a single index.js file, and then use the `tfx` CLI to create a VSIX extension that can be published to the Azure DevOps Marketplace. Signed-off-by: Matthew John Cheetham <[email protected]>
1 parent 3bcb4c4 commit 52b0db4

File tree

12 files changed

+11034
-2
lines changed

12 files changed

+11034
-2
lines changed

.github/workflows/azptask-vsix.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Build Azure DevOps Extension'
2+
on:
3+
pull_request:
4+
push:
5+
tags:
6+
- 'v[0-9]*'
7+
branches:
8+
- main
9+
- 'v[0-9]*'
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: windows-latest
15+
steps:
16+
- uses: actions/checkout@v5
17+
- run: cd azure-pipelines-task
18+
- run: npm ci
19+
- run: npm run build
20+
- run: npm run lint
21+
- run: npm run format && git diff-files
22+
- run: npm run test
23+
- run: npm run package
24+
- uses: actions/upload-artifact@v4
25+
with:
26+
name: vsix
27+
path: ./vsix/*.vsix

azure-pipelines-task/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib
2+
vsix

0 commit comments

Comments
 (0)