Skip to content

Commit

Permalink
Merge pull request #223 from OctopusDeploy/john/v5
Browse files Browse the repository at this point in the history
  • Loading branch information
John Simons authored Mar 22, 2022
2 parents 0559209 + 423b4bd commit d9f210d
Show file tree
Hide file tree
Showing 78 changed files with 15,526 additions and 16,116 deletions.
65 changes: 57 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,76 @@ on:
pull_request:
branches: [ main ]

env:
OCTOPUS_VERSION: 5.0.${{ github.run_number }}

jobs:
build:
name: Build code
runs-on: ubuntu-latest
env:
OCTOPUS_VERSION: 4.3.${{ github.run_number }}
steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '^1.17.7'
- name: Build
run: |
npm install
npm run build -- --extensionVersion $OCTOPUS_VERSION
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist/
test:
name: Run test matrix
needs: build
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
checks: write
strategy:
matrix:
os: [ windows-2022, ubuntu-20.04, macos-11 ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Test
run: |
npm install
npm run test
- uses: dorny/test-reporter@v1
if: success() || failure()
name: Tests report
with:
name: Tests report
path: 'reports/jest-*.xml'
reporter: jest-junit
package:
name: Package and Push artifacts to Octopus
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '^1.17.7'
- name: Embed octo portable
run: |
pwsh ./embed-octo.ps1
Expand All @@ -45,5 +94,5 @@ jobs:
docker run -e "OCTOPUS_CLI_SERVER=${{ secrets.OCTOPUS_URL }}" -e "OCTOPUS_CLI_API_KEY=${{ secrets.INTEGRATIONS_API_KEY }}" -v $(pwd):/src octopusdeploy/octo push --space "Integrations" --package OctoTFS.vsix.$OCTOPUS_VERSION.tar.gz --package OctoTFS.publish.$OCTOPUS_VERSION.tar.gz --overwrite-mode OverwriteExisting
- name: Create Release
run: |
docker run -e "OCTOPUS_CLI_SERVER=${{ secrets.OCTOPUS_URL }}" -e "OCTOPUS_CLI_API_KEY=${{ secrets.INTEGRATIONS_API_KEY }}" -v $(pwd):/src octopusdeploy/octo create-release --space "Integrations" --project "Azure DevOps Extension" --packageVersion $OCTOPUS_VERSION --releaseNumber $OCTOPUS_VERSION
docker run -e "OCTOPUS_CLI_SERVER=${{ secrets.OCTOPUS_URL }}" -e "OCTOPUS_CLI_API_KEY=${{ secrets.INTEGRATIONS_API_KEY }}" -v $(pwd):/src octopusdeploy/octo create-release --space "Integrations" --project "Azure DevOps Extension" --packageVersion $OCTOPUS_VERSION --releaseNumber $OCTOPUS_VERSION --gitRef "${{ (github.ref_type == 'tag' && 'main' ) || (github.head_ref || github.ref) }}" --gitCommit "${{ github.event.after || github.event.pull_request.head.sha }}"
2 changes: 1 addition & 1 deletion .octopus/deployment_process.ocl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ step "Push to Azure Marketplace" {

npm install -g tfx-cli

pwsh $publishPath/publish.ps1 -environment $environment -version $version -accessToken $accessToken -packagePath $vsixPath -manifestsPath $publishPath -shareWith "$shareWith"
pwsh $publishPath/publish.ps1 -environment $environment -version $version -accessToken $accessToken -packagePath $vsixPath -manifestsPath $publishPath -shareWith "$shareWith" || exit 1

if [ "$environment" == "Test" ]
then
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"singleQuote": false,
"printWidth": 250,
"tabWidth": 4,
"trailingComma": "es5"
"trailingComma": "es5",
"endOfLine": "auto"
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ OctoTFS is made up of several tasks to make it easy to integrate TFS and ADO wit

To learn more about how to use the extension and custom tasks, read the [VSTS README](source/vsts.md).

* [Package Application for Octopus](source/tasks/Pack)
* [Push Package(s) to Octopus](source/tasks/Push)
* [Push Package Build Information to Octopus](source/tasks/BuildInformation)
* [Create Octopus Release](source/tasks/CreateOctopusRelease)
Expand Down
3 changes: 2 additions & 1 deletion embed-octo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ param (
$basePath = $PSScriptRoot
)

$buildDirectoryPath = "$basePath/dist"
$ErrorActionPreference = "Stop"

$buildDirectoryPath = "$basePath/dist"

function Copy-Object($object){
$result = New-Object PsObject
Expand Down
4 changes: 2 additions & 2 deletions esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function noFolders(src) {
build({
entryPoints: entryPoints(),
bundle: true,
target: "es6",
target: "es2018",
platform: "node",
outdir: "dist",
metafile: true,
Expand All @@ -67,7 +67,7 @@ build({
copyStaticFiles({ src: "./source", dest: "dist", recursive: false, filter: noFolders }),
copyStaticFiles({ src: "./source/widgets", dest: "dist/widgets" }),
copyStaticFiles({ src: "./node_modules/vss-web-extension-sdk/lib", dest: "dist/widgets/ProjectStatus/lib" }),
//copyStaticFiles({ src: "./source/tasks", dest: "dist/tasks", recursive: true, filter: noTSFiles }),
copyStaticFiles({ src: "./source/tasks", dest: "dist/tasks", filter: noTSFiles }),
copyStaticFiles({ src: "./source/tasksLegacy", dest: "dist/tasks", filter: noTSFiles }),
esbuildPluginNodeExternals(),
],
Expand Down
9 changes: 9 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Config } from "@jest/types";

const config: Config.InitialOptions = {
maxWorkers: 4,
verbose: true,
preset: "ts-jest/presets/js-with-ts",
};

export default config;
6 changes: 2 additions & 4 deletions pack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ function UpdateTaskManifests($workingDirectory, $version, $envName) {
$task = ConvertFrom-JSON -InputObject (Get-Content $taskManifestFile -Raw)
$netVersion = [System.Version]::Parse($version)

if ($task.version.Major -gt 3) {
$task.version.Major = $netVersion.Major
$task.version.Minor = $netVersion.Minor
}
$task.version.Patch = $netVersion.Build

$task.helpMarkDown = "Version: $version. [More Information](https://g.octopushq.com/TFS-VSTS)"
Expand Down Expand Up @@ -127,6 +123,8 @@ function Pack($envName, $environment, $workingDirectory) {
& npm install tfx-cli

& ./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"}
}

if ($setupTaskDependencies -eq $true)
Expand Down
Loading

0 comments on commit d9f210d

Please sign in to comment.