Skip to content

Commit 6ee2044

Browse files
committed
Add support for attaching labels and architectures to uploaded builds
1 parent f169ccd commit 6ee2044

File tree

5 files changed

+43
-3
lines changed

5 files changed

+43
-3
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ Add the "Upload to Buildstash" task to your Azure DevOps pipeline:
4040
platform: 'windows'
4141
stream: 'default'
4242

43+
# Optional build associations
44+
labels: |
45+
to-review
46+
signed
47+
architectures: |
48+
x64
49+
x86
50+
4351
# Optional CI info
4452
ciBuildDuration: '15m30s'
4553

azure-devops-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "buildstash-tasks",
44
"name": "Buildstash",
5-
"version": "1.0.15",
5+
"version": "1.0.16",
66
"publisher": "Buildstash",
77
"targets": [
88
{

tasks/BuildstashUpload/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ async function run() {
147147
const primaryStats = fs.statSync(primaryFilePath);
148148
const primaryFilename = path.basename(primaryFilePath);
149149

150+
// Get labels (if passed in) and parse into an array
151+
const labelsInput = tl.getInput('labels') || '';
152+
const labels = labelsInput
153+
.split(/\r?\n/) // split by newline
154+
.map(label => label.trim()) // remove extra spaces
155+
.filter(label => label.length > 0); // remove blanks
156+
157+
// Get architectures (if passed in) and parse into an array
158+
const architecturesInput = tl.getInput('architectures') || '';
159+
const architectures = architecturesInput
160+
.split(/\r?\n/)
161+
.map(architecture => architecture.trim())
162+
.filter(architecture => architecture.length > 0);
163+
150164
// Prepare request payload
151165
const payload = {
152166
structure: structure,
@@ -160,6 +174,8 @@ async function run() {
160174
version_component_extra: tl.getInput('versionComponentExtra'),
161175
version_component_meta: tl.getInput('versionComponentMeta'),
162176
custom_build_number: tl.getInput('customBuildNumber'),
177+
labels: labels,
178+
architectures: architectures,
163179
source: 'azure-devops',
164180
ci_pipeline: azureBuildPipeline,
165181
ci_run_id: azureBuildId,

tasks/BuildstashUpload/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@buildstash/buildstash-upload",
3-
"version": "1.0.15",
3+
"version": "1.0.16",
44
"description": "Azure DevOps task for uploading build artifacts to Buildstash",
55
"main": "index.js",
66
"scripts": {

tasks/BuildstashUpload/task.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 1,
1616
"Minor": 0,
17-
"Patch": 15
17+
"Patch": 16
1818
},
1919
"instanceNameFormat": "Buildstash Upload",
2020
"inputs": [
@@ -189,6 +189,22 @@
189189
"defaultValue": "",
190190
"required": false,
191191
"helpMarkDown": "Build notes (optional)"
192+
},
193+
{
194+
"name": "labels",
195+
"type": "multiLine",
196+
"label": "Labels",
197+
"defaultValue": "",
198+
"required": false,
199+
"helpMarkDown": "Array of labels to attach to build (will be created if they do not already exist)"
200+
},
201+
{
202+
"name": "architectures",
203+
"type": "multiLine",
204+
"label": "Architectures",
205+
"defaultValue": "",
206+
"required": false,
207+
"helpMarkDown": "Array of architectures this build supports (must be supported by platform)"
192208
}
193209
],
194210
"outputVariables": [

0 commit comments

Comments
 (0)