Update to windows #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: WorkItemClone Build and Release | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
Setup: | |
name: Setup | |
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/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Execute GitVersion | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
useConfigFile: true | |
build: | |
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 --runtime win-x64 | |
- 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 ./ABB.WorkItemClone.AzureDevOps/bin/Debug/net8.0/' | |
if: false | |
shell: pwsh | |
- uses: edgarrc/action-7z@v1 | |
with: | |
args: 7z a -tzip ./output/AzureDevOpsWorkItemClone-v${{needs.Setup.outputs.GitVersion_SemVer}}.zip ./ABB.WorkItemClone.ConsoleUI/bin/Debug/net8.0/** | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: AzureDevOpsWorkItemClone | |
path: ./output/* | |
release: | |
runs-on: ubuntu-latest | |
needs: [build, Setup] | |
steps: | |
- 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}}.zip --generate-notes --prerelease | |
} | |
else { | |
echo "Creating a release." | |
gh release create v${{needs.Setup.outputs.GitVersion_SemVer}} ./AzureDevOpsWorkItemClone-v${{needs.Setup.outputs.GitVersion_SemVer}}.zip --generate-notes --discussion-category "General" | |
} | |
shell: pwsh | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |