-
Notifications
You must be signed in to change notification settings - Fork 6
74 lines (60 loc) · 2.26 KB
/
master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build and Publish VSIX - Manage-AutomationAccount - azure pipeline task
on:
push:
branches:
- master
paths:
- 'Tasks/**/task.json'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.x'
- name: Install Node.js
run: |
choco install nodejs -y -Force
- name: Install tfx-cli
run: |
npm install -g tfx-cli
npm install -g uuid@latest
- name: Install VstsTaskSdk
run: |
# Navigate to the task directory
cd Manage-AutomationAccount
# Create ps_modules directory if it doesn't exist
mkdir -p ps_modules
# Install VstsTaskSdk
Write-Host "VstsTaskSdk installing..."
Save-Module –Name VstsTaskSdk –Path .\ps_modules -Force
cd ps_modules
cd VstsTaskSdk
Write-Host "Directory contains:"
ls
$sourcePath = Get-Location
# find a directory with vstsTaskSdk version
$directoryWithFiles = Get-ChildItem -Path $sourcePath -Directory | Where-Object { (Get-ChildItem $_.FullName -File).Count -gt 0 } | Select-Object -First 1
# If directory cointain file, do process
if ($directoryWithFiles) {
# copy files to root folder
Copy-Item -Path "$($directoryWithFiles.FullName)\*" -Destination $sourcePath -Recurse -Force
Write-Host "Files from subfolder was copied to root folder ($sourcePath)."
# delete subfolder
Remove-Item -Path $directoryWithFiles.FullName -Recurse -Force
Write-Host "Subfolder was deleted."
# get list of files
Write-Host "Moved files to: ($sourcePath) after process:"
Get-ChildItem -Path $sourcePath
} else {
Write-Host "There is no directory with files."
}
- name: Generate and Upload VSIX file
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT_ROMAN_MANAGE_AUTOMATION_ACCOUNT }}
run: |
Write-Host "Start generate and upload VSIX file..."
tfx extension publish --publisher GreyCorbelSolutions --manifest-globs vss-extension.json --token $env:NODE_AUTH_TOKEN