---
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:
- |
apt-get update
apt-get install -y file
pwsh -NonInteractive -c "& {
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
Invoke-FixDevDependency;
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
Invoke-FileLinter
}"
- name: "ScriptAnalyzer"
Invoke-Linter
- name: "Pester"
Invoke-UnitTest -ExcludeTag 'Integration'
- name: "PRComment"
GITEA_TOKEN:
from_secret: GITEA_TOKEN
CUSTOM_PIPELINE_STATE: true
LOG_FILES: "build/*.log"
Send-PRComment
when:
event:
include:
- pull_request
depends_on:
- "Pwsh FileLinter"
- "ScriptAnalyzer"
- "Pester"
- name: "buildState"
Invoke-BuildState
- "PRComment"
name: "Publish Pipeline"
- "Build Pipeline"
- tag
- name: BuildArtifacts
#failure: ignore
Update-ModuleMeta -Verbose
New-BuildPackage -AdditionalPath './src/Rules' -Verbose
- name: GiteaRelease
image: plugins/gitea-release
settings:
api_key:
base_url: https://gitea.ocram85.com
files:
- "bin/${DRONE_REPO_NAME}.zip"
title: ${DRONE_TAG}
note: CHANGELOG.md
- name: "PublishModule"
NuGetToken:
from_secret: PSGallery
Invoke-Publish -Verbose