-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (82 loc) · 3.07 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
94
95
96
97
98
99
name: Publish Release
on:
release:
types: [published]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
CONFIGURATION: "Release"
VERBOSITY: "Minimal"
jobs:
Release:
name: Release TinyCLR
runs-on: [windows-latest]
strategy:
matrix:
dotnet: ['3.1.100']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Extract build information into variables
id: info
run: |
echo "##[set-output name=version;]$(echo $env:GITHUB_REF.Replace('refs/tags/v',''))"
echo "##[set-output name=build;]$(echo $(git rev-list --count HEAD))"
echo "##[set-output name=copyright;]$(echo © $(date -u +%Y) Bytewizer. All rights reserved.)"
- name: Show build information
run: |
echo version=${{ steps.info.outputs.version }}
echo build=${{ steps.info.outputs.build }}
echo copyright=${{ steps.info.outputs.copyright }}
- name: Setup build
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Display dotnet information
run: dotnet --info
- name: Restore packages
run: dotnet restore --verbosity ${env:VERBOSITY}
- name: Build libraries
run: >-
dotnet build -p:BuildNumber="${{ steps.info.outputs.build }}" -p:Version="${{ steps.info.outputs.version }}"
--no-restore
--verbosity ${env:VERBOSITY}
--configuration ${env:CONFIGURATION}
- name: Pack libraries
run: >-
dotnet pack -p:BuildNumber="${{ steps.info.outputs.build }}" -p:PackageVersion="${{ steps.info.outputs.version }}" -p:Copyright="${{ steps.info.outputs.copyright }}"
--include-symbols
--no-restore
--no-build
--verbosity ${env:VERBOSITY}
--configuration ${env:CONFIGURATION}
--output .builds/artifacts
- name: Upload release artifacts
uses: actions/upload-artifact@v1
with:
name: Release
path: .builds/artifacts
- name: Create release asset
run: Compress-Archive -DestinationPath .builds/packages.zip -Path .builds/artifacts/*.*nupkg
- name: Upload release asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: .builds/packages.zip
asset_name: Packages.zip
asset_content_type: application/zip
- name: Setup nuget
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-version: 'latest'
# - name: Publish package to github
# run: |
# nuget source Add -Name "GitHub" -Source "https://nuget.pkg.github.com/microcompiler/index.json" -UserName microcompiler -Password ${{secrets.GITHUB_TOKEN}}
# nuget push artifacts/*.nupkg -Source "GitHub"
# - name: Publish package to nuget
# run: |
# nuget sources Add -Name "NuGet" -Source "https://int.nugettest.org"
# nuget push artifacts/*.*nupkg -Source "NuGet"