2022-07-13 13:59:25 +02:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: "Build Pipeline"
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
exclude:
|
|
|
|
- droneDocs/*
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Pwsh FileLinter"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
failure: ignore
|
|
|
|
environment:
|
|
|
|
EXCLUDE: "(.exe|.dll|.ico|.gitkeep)"
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-13 15:09:01 +02:00
|
|
|
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
|
|
|
|
Invoke-FixDevDependency;
|
2022-07-13 14:45:23 +02:00
|
|
|
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
|
2022-07-13 13:59:25 +02:00
|
|
|
Invoke-FileLinter
|
|
|
|
}"
|
|
|
|
|
|
|
|
- name: "ScriptAnalyzer"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
failure: ignore
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-13 15:09:01 +02:00
|
|
|
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
|
|
|
|
Invoke-FixDevDependency;
|
2022-07-13 14:45:23 +02:00
|
|
|
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
|
2022-07-13 13:59:25 +02:00
|
|
|
Invoke-Linter
|
|
|
|
}"
|
|
|
|
|
|
|
|
- name: "Pester"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
failure: ignore
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-13 15:09:01 +02:00
|
|
|
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
|
|
|
|
Invoke-FixDevDependency;
|
2022-07-13 14:45:23 +02:00
|
|
|
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
|
2022-07-13 13:59:25 +02:00
|
|
|
Invoke-UnitTest -ExcludeTag 'Integration'
|
|
|
|
}"
|
|
|
|
|
|
|
|
- name: "PRComment"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
failure: ignore
|
|
|
|
environment:
|
|
|
|
GITEA_TOKEN:
|
|
|
|
from_secret: GITEA_TOKEN
|
|
|
|
CUSTOM_PIPELINE_STATE: true
|
|
|
|
LOG_FILES: "build/*.log"
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-13 15:09:01 +02:00
|
|
|
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
|
|
|
|
Invoke-FixDevDependency;
|
2022-07-13 14:45:23 +02:00
|
|
|
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
|
2022-07-13 13:59:25 +02:00
|
|
|
Send-PRComment
|
|
|
|
}"
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
include:
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
- name: "buildState"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-13 15:09:01 +02:00
|
|
|
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
|
|
|
|
Invoke-FixDevDependency;
|
2022-07-13 14:45:23 +02:00
|
|
|
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
|
2022-07-13 13:59:25 +02:00
|
|
|
Invoke-BuildState
|
|
|
|
}"
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: "Publish Pipeline"
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- "Build Pipeline"
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: BuildArtifacts
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
#failure: ignore
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-13 15:09:01 +02:00
|
|
|
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
|
|
|
|
Invoke-FixDevDependency;
|
2022-07-13 14:45:23 +02:00
|
|
|
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
|
2022-07-13 13:59:25 +02:00
|
|
|
Update-ModuleMeta -Verbose
|
|
|
|
}"
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-13 15:09:01 +02:00
|
|
|
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
|
|
|
|
Invoke-FixDevDependency;
|
2022-07-13 14:45:23 +02:00
|
|
|
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
|
2022-07-13 13:59:25 +02:00
|
|
|
New-BuildPackage -AdditionalPath './src/Rules' -Verbose
|
|
|
|
}"
|
|
|
|
|
|
|
|
- name: GiteaRelease
|
|
|
|
image: plugins/gitea-release
|
|
|
|
settings:
|
|
|
|
api_key:
|
|
|
|
from_secret: GITEA_TOKEN
|
|
|
|
base_url: https://gitea.ocram85.com
|
|
|
|
files:
|
|
|
|
- "bin/${DRONE_REPO_NAME}.zip"
|
|
|
|
title: ${DRONE_TAG}
|
|
|
|
note: CHANGELOG.md
|
|
|
|
|
|
|
|
- name: "PublishModule"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
#failure: ignore
|
|
|
|
environment:
|
|
|
|
NexusToken:
|
|
|
|
from_secret: NexusToken
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-13 15:09:01 +02:00
|
|
|
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
|
|
|
|
Invoke-FixDevDependency;
|
2022-07-13 14:45:23 +02:00
|
|
|
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
|
2022-07-13 13:59:25 +02:00
|
|
|
Invoke-Publish -Verbose
|
|
|
|
}"
|