Skip to content

feat(AzureDevOps.WorkItemClone.ConsoleUI): add support for YAML confi… #155

feat(AzureDevOps.WorkItemClone.ConsoleUI): add support for YAML confi…

feat(AzureDevOps.WorkItemClone.ConsoleUI): add support for YAML confi… #155

Workflow file for this run

name: WorkItemClone Build and Release
on:
push:
workflow_dispatch:
env:
APP_ID: "Iv23li9aYvt0VW9x4Jhh"
PRIVATE_KEY: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}
jobs:
Setup:
name: "Setup & Configuration"
runs-on: ubuntu-latest
outputs:
GitVersion_BranchName: ${{ steps.gitversion.outputs.GitVersion_BranchName }}
GitVersion_SemVer: ${{ steps.gitversion.outputs.GitVersion_SemVer }}
GitVersion_PreReleaseLabel: ${{ steps.gitversion.outputs.GitVersion_PreReleaseLabel }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.x'
includePrerelease: true
- name: Execute GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v1.1.1
with:
useConfigFile: true
build:
name: "Build & Test"
runs-on: ubuntu-latest
needs: Setup
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x
- run: dotnet build
- run: dotnet test
- run: 'Get-ChildItem -Directory -Recurse'
if: false
shell: pwsh
- run: 'Get-ChildItem -Directory -Recurse -Path ./'
if: false
shell: pwsh
- run: 'Get-ChildItem -Recurse -Path ./AzureDevOps.WorkItemClone.ConsoleUI/bin/Debug/net8.0/win-x64/'
if: false
shell: pwsh
- uses: edgarrc/action-7z@v1
with:
args: 7z a -tzip ./output/AzureDevOpsWorkItemClone-v${{needs.Setup.outputs.GitVersion_SemVer}}-win-x64.zip ./AzureDevOps.WorkItemClone.ConsoleUI/bin/Debug/net8.0/win-x64/**
- uses: actions/upload-artifact@v4
with:
name: AzureDevOpsWorkItemClone
path: ./output/*
Wiki:
name: "Release to GitHub Wiki"
runs-on: ubuntu-latest
needs: [build, Setup]
if: ${{ success() && ( needs.Setup.outputs.GitVersion_PreReleaseLabel == 'Preview' || needs.Setup.outputs.GitVersion_PreReleaseLabel == '' ) }}
steps:
- uses: actions/checkout@v3
- uses: spenserblack/actions-wiki@v0.3.0
with:
# Whatever directory you choose will be mirrored to the GitHub
# .wiki.git. The default is .github/wiki.
path: docs
release:
name: "Release to GitHub Releases"
runs-on: ubuntu-latest
needs: [build, Setup]
if: ${{ success() && ( needs.Setup.outputs.GitVersion_PreReleaseLabel == 'Preview' || needs.Setup.outputs.GitVersion_PreReleaseLabel == '' ) }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: AzureDevOpsWorkItemClone
- name: "Release WorkItemClone"
run: |
echo "GitVersion_BranchName: ${{needs.Setup.outputs.GitVersion_BranchName}}"
echo "GitVersion_SemVer: ${{needs.Setup.outputs.GitVersion_SemVer}}"
echo "GitVersion_PreReleaseLabel: ${{needs.Setup.outputs.GitVersion_PreReleaseLabel}}"
if ( "${{needs.Setup.outputs.GitVersion_PreReleaseLabel}}" -eq "Preview" ) {
echo "Creating a prerelease release."
gh release create v${{needs.Setup.outputs.GitVersion_SemVer}} ./AzureDevOpsWorkItemClone-v${{needs.Setup.outputs.GitVersion_SemVer}}-win-x64.zip --generate-notes --prerelease
exit 0
}
if ( "${{needs.Setup.outputs.GitVersion_PreReleaseLabel}}" -eq "" ) {
echo "Creating a release."
gh release create v${{needs.Setup.outputs.GitVersion_SemVer}} ./AzureDevOpsWorkItemClone-v${{needs.Setup.outputs.GitVersion_SemVer}}-win-x64.zip --generate-notes --discussion-category "Announcements"
exit 0
}
shell: pwsh
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}