-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (88 loc) · 3.73 KB
/
release.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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
on:
push:
tags:
- 'v*' # When a version is tagged
name: Upload Release Asset
jobs:
build:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.11
with:
versionSpec: '5.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.11
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
8.x
- name: Build with dotnet
run: dotnet build --configuration Release -p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }}
- name: Test with dotnet
run: dotnet test --configuration Release --no-build
- uses: actions/upload-artifact@v2
with:
name: nuget
path: "./Kontent.Statiq/bin/Release/Kontent.Statiq.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg"
- uses: actions/upload-artifact@v2
with:
name: nugetsymbols
path: "./Kontent.Statiq/bin/Release/Kontent.Statiq.${{steps.gitversion.outputs.nuGetVersionV2}}.snupkg"
outputs:
nugetversion: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
prerelease: ${{ steps.gitversion.outputs.preReleaseTag != '' }}
packagefile: "Kontent.Statiq.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg"
packageSymbolsfile: "Kontent.Statiq.${{steps.gitversion.outputs.nuGetVersionV2}}.snupkg"
publish:
needs: build
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Download build artifact - package
uses: actions/download-artifact@v2
with:
name: nuget
path: ./
- name: Download build artifact - package symbols
uses: actions/download-artifact@v2
with:
name: nugetsymbols
path: ./
- run: ls -R
- 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 ${{ needs.build.outputs.nugetversion }}
draft: true
prerelease: ${{ needs.build.outputs.prerelease }}
- name: Upload Release Asset - Nuget package
id: upload-release-asset1
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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: "./${{ needs.build.outputs.packagefile }}"
asset_name: ${{ needs.build.outputs.packagefile }}
asset_content_type: application/zip
- name: Upload Release Asset - Nuget symbols package
id: upload-release-asset2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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: "./${{ needs.build.outputs.packageSymbolsfile }}"
asset_name: ${{ needs.build.outputs.packageSymbolsfile }}
asset_content_type: application/zip