Skip to content

Commit fd88a9f

Browse files
committed
Support for Pipelines
1 parent 1fda1a2 commit fd88a9f

File tree

4 files changed

+50
-14
lines changed

4 files changed

+50
-14
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ jobs:
2929
uses: onlyutkarsh/[email protected]
3030
with:
3131
files: vss-extension.json
32-
patch-syntax: = /version => "3.3.${{ github.run_number }}"
32+
patch-syntax: = /version => "4.0.${{ github.run_number }}"
3333
fail-if-no-files-patched: true
3434

3535
- name: Patch task.json
3636
uses: onlyutkarsh/[email protected]
3737
with:
3838
files: ElmahIoDeploymentNotification/task.json
3939
patch-syntax: |
40-
= /version/Major => "3"
41-
= /version/Minor => "3"
40+
= /version/Major => "4"
41+
= /version/Minor => "0"
4242
= /version/Patch => "${{ github.run_number }}"
4343
fail-if-no-files-patched: true
4444

@@ -55,8 +55,8 @@ jobs:
5555
env:
5656
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
5757
with:
58-
tag_name: 3.3.${{ github.run_number }}
59-
release_name: Release 3.3.${{ github.run_number }}
58+
tag_name: 4.0.${{ github.run_number }}
59+
release_name: Release 4.0.${{ github.run_number }}
6060
draft: false
6161

6262
- name: Upload vsix
@@ -66,6 +66,6 @@ jobs:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767
with:
6868
upload_url: ${{ steps.create_release.outputs.upload_url }}
69-
asset_path: ./elmahio.deploy-tasks-3.3.${{ github.run_number }}.vsix
70-
asset_name: elmahio.deploy-tasks-3.3.${{ github.run_number }}.vsix
69+
asset_path: ./elmahio.deploy-tasks-4.0.${{ github.run_number }}.vsix
70+
asset_name: elmahio.deploy-tasks-4.0.${{ github.run_number }}.vsix
7171
asset_content_type: application/zip

ElmahIoDeploymentNotification/notify.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,42 @@ Trace-VstsEnteringInvocation $MyInvocation
33
$apiKey = Get-VstsInput -Name "apiKey" -Require
44
$logId = Get-VstsInput -Name "logId"
55
$version = Get-VstsInput -Name "version" -Require
6+
$description = ""
7+
$userName = ""
8+
$userEmail = ""
9+
10+
if ($Env:RELEASE_RELEASENAME) {
11+
if (-not $version) {
12+
$version = $Env:RELEASE_RELEASENAME
13+
}
14+
$description = $Env:RELEASE_RELEASEDESCRIPTION
15+
$userName = $Env:RELEASE_REQUESTEDFOR
16+
} else {
17+
if (-not $version) {
18+
$version = $Env:BUILD_BUILDNUMBER
19+
}
20+
$description = $BUILD_SOURCEVERSIONMESSAGE
21+
$userName = $BUILD_SOURCEVERSIONAUTHOR
22+
$userEmail = $BUILD_SOURCEVERSIONAUTHOREMAIL
23+
if (-not $userEmail) {
24+
$userEmail = $(git log -1 --pretty=format:'%ae')
25+
}
26+
}
27+
28+
if (-not $version) {
29+
if ($Env:RELEASE_RELEASENAME) {
30+
$version = $Env:RELEASE_RELEASENAME
31+
} else {
32+
$version = $Env:BUILD_BUILDNUMBER
33+
}
34+
}
35+
36+
$userName = ""
37+
if ($Env:RELEASE_REQUESTEDFOR) {
38+
userName = $Env:RELEASE_REQUESTEDFOR
39+
} else {
40+
userName = $BUILD_SOURCEVERSIONAUTHOR
41+
}
642

743
$ProgressPreference = "SilentlyContinue"
844
$url = 'https://api.elmah.io/v3/deployments?api_key=' + $apiKey

ElmahIoDeploymentNotification/task.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
],
1212
"author": "elmah.io",
1313
"version": {
14-
"Major": 3,
15-
"Minor": 2,
16-
"Patch": 3
14+
"Major": 4,
15+
"Minor": 0,
16+
"Patch": 0
1717
},
1818
"demands": [],
1919
"minimumAgentVersion": "1.104.0",
@@ -36,9 +36,9 @@
3636
"name": "version",
3737
"type": "string",
3838
"label": "Version",
39-
"defaultValue": "$Env:RELEASE_RELEASENAME",
40-
"required": true,
41-
"helpMarkDown": "Override to pick a custom naming scheme for your versions. Must be a valid PowerShell string."
39+
"defaultValue": "",
40+
"required": false,
41+
"helpMarkDown": "Override to pick a custom naming scheme for your versions. If not specified, the task will use RELEASE_RELEASENAME for releases and BUILD_BUILDNUMBER for pipelines."
4242
}
4343
],
4444
"instanceNameFormat": "elmah.io Deployment Notification $(project)",

vss-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": "deploy-tasks",
44
"name": "elmah.io Deployment Tasks",
5-
"version": "3.2.3",
5+
"version": "4.0.0",
66
"publisher": "elmahio",
77
"tags": [
88
"Error",

0 commit comments

Comments
 (0)