-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (48 loc) · 1.74 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Dot-Net-Core
on:
push:
branches:
- main
jobs:
CI:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
# Setup ms build
- name: Setup MSBuild
uses: microsoft/[email protected]
with:
msbuild-version: '16.0'
# setup GH Cli
- name: Download and Install GitHub CLI
run: |
Invoke-WebRequest -Uri "https://github.com/cli/cli/releases/download/v2.31.0/gh_2.31.0_windows_386.msi" -OutFile "gh.msi"
Start-Process -Wait -FilePath "msiexec.exe" -ArgumentList "/i gh.msi /quiet"
gh --version
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.408
include-prerelease: true
include: web
# Build the Code using MS Build
- name: Build with MSBuild
run: msbuild /p:Configuration=Release /t:restore,build /p:UseSharedCompilation=false
- name: Package the code
run: dotnet pack --configuration Release --output ./packages
- name: Publish artifacts
uses: actions/upload-artifact@v2
with:
name: packages
path: ./packages
# - name: Package and publish to GitHub Releases
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# # Create a build folder and copy the necessary files
# New-Item -ItemType Directory -Force -Path "build"
# Copy-Item -Path "./bin/Release/**" -Destination "build"
# # Compress the build folder
# Compress-Archive -Path "build" -DestinationPath "dot-net-code.zip"
# # Publish the release using GitHub CLI
# gh release create "publish-V1" -t "v1" "dot-net-code.zip"