Skip to content

Commit 70ce4b5

Browse files
authored
Merge pull request #61 from Infragistics/create-pipelines
Create build.yml
2 parents f2da118 + 3b42176 commit 70ce4b5

2 files changed

Lines changed: 99 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build WPF Samples
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
# .NET Framework applications must be built on a Windows runner.
14+
runs-on: windows-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup MSBuild
21+
uses: microsoft/setup-msbuild@v2
22+
with:
23+
msbuild-architecture: x64
24+
25+
- name: Setup NuGet
26+
uses: NuGet/setup-nuget@v2
27+
28+
- name: Restore NuGet packages
29+
run: nuget restore Examples/Infragistics.Samples.WPF.sln
30+
31+
- name: Build the solution
32+
run: |
33+
$outputDir = "$env:GITHUB_WORKSPACE\build_output"
34+
Write-Host "Building to specific directory: $outputDir"
35+
msbuild Examples/Infragistics.Samples.WPF.sln /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=$outputDir\
36+
37+
- name: Upload the artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: wpf-app-release
41+
path: build_output
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Create Release and Upload Artifact
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Trigger this workflow only when a new tag is pushed
7+
8+
jobs:
9+
build_and_release:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup MSBuild
17+
uses: microsoft/setup-msbuild@v2
18+
with:
19+
msbuild-architecture: x64
20+
21+
- name: Setup NuGet
22+
uses: NuGet/setup-nuget@v2
23+
24+
- name: Restore NuGet packages
25+
run: nuget restore Examples/Infragistics.Samples.WPF.sln
26+
27+
- name: Build the solution with forced output directory
28+
run: |
29+
$outputDir = "$env:GITHUB_WORKSPACE\build_output"
30+
Write-Host "Building to specific directory: $outputDir"
31+
msbuild Examples/Infragistics.Samples.WPF.sln /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=$outputDir\
32+
33+
- name: Zip the build output
34+
run: |
35+
$outputPath = "$env:GITHUB_WORKSPACE\build_output"
36+
Compress-Archive -Path "$outputPath\*" -DestinationPath "wpf-app-release.zip" -Force
37+
Write-Host "Zipping complete."
38+
39+
- name: Create Release
40+
id: create_release
41+
uses: actions/create-release@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
tag_name: ${{ github.ref }}
46+
release_name: Release ${{ github.ref }}
47+
draft: false
48+
prerelease: false
49+
50+
- name: Upload Release Asset
51+
uses: actions/upload-release-asset@v1
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
upload_url: ${{ steps.create_release.outputs.upload_url }}
56+
asset_path: ./wpf-app-release.zip
57+
asset_name: wpf-app-release.zip
58+
asset_content_type: application/zip

0 commit comments

Comments
 (0)