-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (36 loc) · 1.58 KB
/
Build_and_publish_package.yml
File metadata and controls
42 lines (36 loc) · 1.58 KB
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
name: Build and Deploy Packages
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: windows-2022
steps:
# Checkout repo into build area
- uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone
# Build and deploy nuget package
# We include the GitHub package source so that we can reference current packages and also so that we can push to the package repo
- name: Build Project and Package
env:
MINVERVERSIONOVERRIDE: '1.164.0'
run: |
dotnet nuget add source "https://nuget.pkg.github.com/mendix/index.json" --name "GitHub" --username ${{ secrets.GHPACKAGESUSER }} --password ${{ secrets.GHPACKAGESTOKEN }}
dotnet pack --configuration Release --output "mx_nuget" LibGit2Sharp/LibGit2Sharp.csproj
shell: powershell # Keep as powershell and not pwsh
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: nuget package
path: ${{ github.workspace }}/**/*.nupkg
# After build we copy the binaries to package output folder
# Finally we pack and push the package to github packages
- name: Deploy Package
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
dotnet nuget add source "https://nuget.pkg.github.com/mendix/index.json" --name "GitHub" --username ${{ secrets.GHPACKAGESUSER }} --password ${{ secrets.GHPACKAGESTOKEN }}
dotnet nuget push "**/mx_nuget/Mendix.LibGit2Sharp*.nupkg" --source "GitHub" --skip-duplicate
shell: powershell # Keep as powershell and not pwsh