forked from mono/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (70 loc) · 2.63 KB
/
Copy pathlibgit2sharp.yml
File metadata and controls
80 lines (70 loc) · 2.63 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: .NET
on:
push:
branches:
- dotdevelop
pull_request:
branches:
- dotdevelop
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.401
- name: Restore dependencies
run: dotnet restore LibGit2Sharp.sln
- name: Build
run: dotnet build --no-restore LibGit2Sharp.sln
- name: Pack
run: |
echo running on branch $(echo ${GITHUB_SHA} | cut -c1-10)
dotnet pack --include-symbols -c Release LibGit2Sharp.sln
ls ./bin/Packages/Release/
- name: Short Sha
id: short-sha
run: echo "::set-output name=short_sha::$(echo ${GITHUB_SHA} | cut -c1-10)"
- name: Push generated package to GitHub registry
run: dotnet nuget push ./bin/Packages/Release/LibGit2Sharp.0.27.0-preview-g${{steps.short-sha.outputs.short_sha}}.nupkg --source https://nuget.pkg.github.com/dotdevelop --api-key ${{github.token}} --skip-duplicate --no-symbols true
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHORT_SHA: ${{ steps.short-sha.outputs.short_sha }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./bin/Packages/Release/LibGit2Sharp.0.27.0-preview-g${{steps.short-sha.outputs.short_sha}}.nupkg
asset_name: LibGit2Sharp.0.27.0-preview-g${{steps.short-sha.outputs.short_sha}}.nupkg
asset_content_type: application/nupkg
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.401
- name: Restore dependencies
run: dotnet restore LibGit2Sharp.sln
- name: Build
run: dotnet build --no-restore LibGit2Sharp.sln
- name: Test
run: dotnet test --no-build --verbosity normal LibGit2Sharp.sln