This repository has been archived on 2023-10-10. You can view files and clone it, but cannot push or open issues or pull requests.
DroneHelper/.drone.yml
Marco Blessing 5559445d7e
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build was killed
Fix drone build pipeline (#1)
#### 📖 Summary

- fixes dependency for loading the module itself
- adds gitea user as parameter -> deletes old PR comments.

#### 📑 Test Plan

> 💡 Select your test plan for the code changes.

- [x] Tested via Drone.io pipeline
- [ ] Custom test
- [ ] No test plan

##### Details / Justification

<!-- Add your test details or justification for missing tests here. -->

#### 📚 Additional Notes

<!-- A place for additional detail notes. -->

Co-authored-by: OCram85 <marco.blessing@googlemail.com>
Reviewed-on: #1
2022-07-13 16:19:33 +02:00

153 lines
3.9 KiB
YAML

---
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"
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
failure: ignore
commands:
- |
pwsh -NonInteractive -c "& {
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
Invoke-FixDevDependency;
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
Invoke-Linter
}"
- name: "Pester"
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
failure: ignore
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-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 "& {
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
Invoke-FixDevDependency;
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
Send-PRComment
}"
when:
event:
include:
- pull_request
depends_on:
- "Pwsh FileLinter"
- "ScriptAnalyzer"
- "Pester"
- name: "buildState"
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
commands:
- |
pwsh -NonInteractive -c "& {
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
Invoke-FixDevDependency;
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
Invoke-BuildState
}"
depends_on:
- "PRComment"
---
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 "& {
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
Invoke-FixDevDependency;
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
Update-ModuleMeta -Verbose
}"
- |
pwsh -NonInteractive -c "& {
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
Invoke-FixDevDependency;
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
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:
NuGetToken:
from_secret: PSGallery
commands:
- |
pwsh -NonInteractive -c "& {
Import-Module './tools/DevDependency.psm1' -ErrorAction 'Stop';
Invoke-FixDevDependency;
Import-Module './src/DroneHelper.psd1' -ErrorAction 'Stop';
Invoke-Publish -Verbose
}"