Skip to content

Commit 9e780ed

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 9e780ed

File tree

13 files changed

+11042
-5
lines changed

13 files changed

+11042
-5
lines changed

.github/workflows/azptask-vsix.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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: npm ci
18+
working-directory: azure-pipelines-task
19+
- run: npm run build
20+
working-directory: azure-pipelines-task
21+
- run: npm run lint
22+
working-directory: azure-pipelines-task
23+
- run: npm run format && git diff-files
24+
working-directory: azure-pipelines-task
25+
- run: npm run test
26+
working-directory: azure-pipelines-task
27+
- run: npm run package
28+
working-directory: azure-pipelines-task
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: vsix
32+
path: ./azure-pipelines-task/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)