Skip to content

Commit

Permalink
feat: Azure Devop steps v6 (#292)
Browse files Browse the repository at this point in the history
feat: New steps for Zip/NuGet pack (#276)
feat:push step v6 (#277)
feat: deploy release v6 (#278)
feat: deploy tenant release v6 (#281)
feat: await task (#282)
feat: Run runbook step (#285)
feat: Create release v6 (#283)
chore: updated the way user agent strings are built for the v6 steps (#287)
feat: push build information v6 (#284)
chore: Added output variable definitions for the Pack steps
feat: CLI installer step - v6 (#279)
chore: added warning logs for use of additional arguments fields (#286)
chore: fixed some pluralisation inconsistencies

Co-authored-by: Ben Pearce <[email protected]>
  • Loading branch information
slewis74 and benPearce1 authored Feb 8, 2023
1 parent 69eb8fa commit 367e093
Show file tree
Hide file tree
Showing 105 changed files with 4,215 additions and 154 deletions.
35 changes: 15 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ on:
required: true

env:
PACKAGE_VERSION: 5.2.${{ github.run_number }}
OCTOPUS_CLI_SERVER: ${{ secrets.OCTOPUS_URL }}
OCTOPUS_CLI_API_KEY: ${{ secrets.INTEGRATIONS_API_KEY }}
PACKAGE_VERSION: 6.0.${{ github.run_number }}
OCTOPUS_URL: ${{ secrets.OCTOPUS_URL }}
OCTOPUS_API_KEY: ${{ secrets.INTEGRATIONS_API_KEY }}

jobs:
build:
Expand All @@ -32,9 +32,9 @@ jobs:
outputs:
package_version: ${{ steps.build.outputs.package_version }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
Expand All @@ -45,7 +45,7 @@ jobs:
npm ci
npm run build -- --extensionVersion $PACKAGE_VERSION
echo "::set-output name=package_version::$PACKAGE_VERSION"
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
Expand All @@ -62,9 +62,9 @@ jobs:
matrix:
os: [windows-2022, ubuntu-20.04, macos-11]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
Expand All @@ -88,21 +88,21 @@ jobs:
if: github.event_name == 'release' || (github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]')
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: dist
path: dist

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"

- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: "^1.17.7"
go-version: "^1.19.5"

- name: Embed octo portable
run: |
Expand All @@ -117,16 +117,11 @@ jobs:
- name: Create Packages
id: create-packages
run: |
tar -czf OctoTFS.vsix.${{ needs.build.outputs.package_version }}.tar.gz ./dist/Artifacts/**/*.vsix
tar -czf OctoTFS.vsix.${{ needs.build.outputs.package_version }}.tar.gz ./Artifacts/**/*.vsix
tar -czf OctoTFS.publish.${{ needs.build.outputs.package_version }}.tar.gz ./publish.ps1 ./dist/extension-manifest*.json
- name: Install Octopus CLI 🐙
uses: OctopusDeploy/[email protected]
with:
version: "*"

- name: Push Package 🐙
uses: OctopusDeploy/push-package-action@v1.1.2
uses: OctopusDeploy/push-package-action@v3
with:
space: "Integrations"
packages: |
Expand All @@ -143,7 +138,7 @@ jobs:
echo "::set-output name=release-note-file::$OUTPUT_FILE"
- name: Create a release in Octopus Deploy 🐙
uses: OctopusDeploy/create-release-action@v1.1.1
uses: OctopusDeploy/create-release-action@v3
with:
space: "Integrations"
project: "Azure DevOps Extension"
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
modules
Artifacts

# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/
Expand Down Expand Up @@ -121,4 +123,8 @@ dist/
*.received.*
*.DS_Store

*.iml
*.iml

modules/*
reports/*
.taskkey
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/task.json
7 changes: 7 additions & 0 deletions localBuild.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rm -r dist
call npm run build -- --extensionVersion %*
rm -r modules

setlocal
cd "%~dp0"
powershell -NoProfile -ExecutionPolicy Unrestricted .\pack.ps1 LocalTest %* -setupTaskDependencies
6 changes: 6 additions & 0 deletions localbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
rm -r dist
npm run build -- --extensionVersion $1
rm -r modules
mkdir dist
pwsh -NoProfile -ExecutionPolicy Unrestricted ./pack.ps1 LocalTest $1 -setupTaskDependencies
16 changes: 8 additions & 8 deletions pack.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
param (
[Parameter(Mandatory=$true,HelpMessage="LocalTest, Test or Production")]
[Parameter(Mandatory = $true, HelpMessage = "LocalTest, Test or Production")]
[ValidateSet("LocalTest", "Test", "Production")]
[string]
$environment,
[Parameter(Mandatory=$true,HelpMessage="The three number version for this release")]
[Parameter(Mandatory = $true, HelpMessage = "The three number version for this release")]
[string]
$version,
[switch]
Expand All @@ -15,7 +15,7 @@ param (
$ErrorActionPreference = "Stop"

$buildDirectoryPath = "$basePath/dist"
$buildArtifactsPath = "$buildDirectoryPath/Artifacts"
$buildArtifactsPath = "$basePath/Artifacts"

function UpdateExtensionManifestOverrideFile($workingDirectory, $environment, $version) {
Write-Host "Finding environment-specific manifest overrides..."
Expand Down Expand Up @@ -81,8 +81,7 @@ function Get-TaskId($envName, $taskName) {
$taskIds = ConvertFrom-Json -InputObject (Get-Content "$basePath/task-ids.json" -Raw)
$result = $taskIds.$envName.$taskName

if([String]::IsNullOrEmpty($result))
{
if ([String]::IsNullOrEmpty($result)) {
throw "Could not find task $taskName ID for environment $envName. Failing as this is required and will prevent the extension from installing otherwise."
}
return $result
Expand Down Expand Up @@ -127,11 +126,12 @@ function Pack($envName, $environment, $workingDirectory) {

& ./node_modules/.bin/tfx extension create --root $workingDirectory --manifest-globs extension-manifest.json --overridesFile $overridesFile --outputPath "$buildArtifactsPath/$environment" --no-prompt

if (-not $?) {throw "Failed to create extension. Exit Code $LASTEXITCODE"}
& npm uninstall tfx-cli
if (-not $?) { throw "Failed to create extension. Exit Code $LASTEXITCODE" }

}

if ($setupTaskDependencies -eq $true)
{
if ($setupTaskDependencies -eq $true) {
SetupTaskDependencies $buildDirectoryPath
}
Pack "VSTSExtensions" $environment $buildDirectoryPath
Loading

0 comments on commit 367e093

Please sign in to comment.