-
Notifications
You must be signed in to change notification settings - Fork 13
161 lines (139 loc) · 6.79 KB
/
dotnet-core-release.yml
File metadata and controls
161 lines (139 loc) · 6.79 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: dotnet-core-release
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# dotnet: [ '2.2.x', '3.0.x', '3.1.x' ]
dotnet: [ '3.1.202' ]
name: dotnet core ${{ matrix.dotnet }}
steps:
- name: Get variables
run: |
echo ::set-env name=APP_NAME::sortxml
echo ::set-env name=TAG_NAME::${GITHUB_REF#refs/*/}
- name: Get source
uses: actions/checkout@master
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.4.0
with:
dotnet-version: ${{ matrix.dotnet }}
# - name: Restore
# run: dotnet restore
# - name: Build
# run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --verbosity normal
- 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 ${{ env.TAG_NAME }}
draft: false
prerelease: false
- name: "Publish: win-x64"
run: |
dotnet restore --runtime win-x64
dotnet publish --nologo --configuration Release --runtime win-x64 --framework netcoreapp3.1 --output ./win-x64/ --self-contained false
zip --junk-paths ./${{ env.APP_NAME }}-win-x64-${{ env.TAG_NAME }}.zip ./win-x64/*
- name: "Upload: win-x64"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.APP_NAME }}-win-x64-${{ env.TAG_NAME }}.zip
asset_name: ${{ env.APP_NAME }}-win-x64-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip
- name: "Publish: win-x86"
run: |
dotnet restore --runtime win-x86
dotnet publish --nologo --configuration Release --runtime win-x86 --framework netcoreapp3.1 --output ./win-x86/ --self-contained false
zip -o -7 --junk-paths ./${{ env.APP_NAME }}-win-x86-${{ env.TAG_NAME }}.zip ./win-x86/*
- name: "Upload: win-x86"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# 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
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.APP_NAME }}-win-x86-${{ env.TAG_NAME }}.zip
asset_name: ${{ env.APP_NAME }}-win-x86-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip
- name: "Publish: win-arm"
run: |
dotnet restore --runtime win-arm
dotnet publish --nologo --configuration Release --runtime win-arm --framework netcoreapp3.1 --output ./win-arm/ --self-contained false
zip -o -7 --junk-paths ./${{ env.APP_NAME }}-win-arm-${{ env.TAG_NAME }}.zip ./win-arm/*
- name: "Upload: win-arm"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.APP_NAME }}-win-arm-${{ env.TAG_NAME }}.zip
asset_name: ${{ env.APP_NAME }}-win-arm-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip
# - name: "Publish: win-x64-self-contained"
# run: |
# dotnet restore
# dotnet publish --nologo --configuration Release --runtime win-x64 --framework netcoreapp3.1 --output ./win-x64-self-contained/ --self-contained true
# zip --junk-paths ./${{ env.APP_NAME }}-win-x64-self-contained-${{ env.TAG_NAME }}.zip ./win-x64-self-contained/*
# - name: "Upload: win-x64-self-contained"
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./${{ env.APP_NAME }}-win-x64-self-contained-${{ env.TAG_NAME }}.zip
# asset_name: ${{ env.APP_NAME }}-win-x64-self-contained-${{ env.TAG_NAME }}.zip
# asset_content_type: application/zip
- name: "Publish: linux-x64"
run: |
dotnet restore --runtime linux-x64
dotnet publish --nologo --configuration Release --runtime linux-x64 --framework netcoreapp3.1 --output ./publish/linux-x64/ --self-contained false
zip -o -7 --junk-paths ./${{ env.APP_NAME }}-linux-x64-${{ env.TAG_NAME }}.zip ./publish/linux-x64/*
- name: "Upload: linux-x64"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.APP_NAME }}-linux-x64-${{ env.TAG_NAME }}.zip
asset_name: ${{ env.APP_NAME }}-linux-x64-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip
- name: "Publish: linux-arm"
run: |
dotnet restore --runtime linux-arm
dotnet publish --nologo --configuration Release --runtime linux-arm --framework netcoreapp3.1 --output ./publish/linux-arm/ --self-contained false
zip -o -7 --junk-paths ./${{ env.APP_NAME }}-linux-arm-${{ env.TAG_NAME }}.zip ./publish/linux-arm/*
- name: "Upload: linux-arm"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.APP_NAME }}-linux-arm-${{ env.TAG_NAME }}.zip
asset_name: ${{ env.APP_NAME }}-linux-arm-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip
- name: "Publish: osx-x64"
run: |
dotnet restore --runtime osx-x64
dotnet publish --nologo --configuration Release --runtime osx-x64 --framework netcoreapp3.1 --output ./publish/osx-x64/ --self-contained false
zip -o -7 --junk-paths ./${{ env.APP_NAME }}-osx-x64-${{ env.TAG_NAME }}.zip ./publish/osx-x64/*
- name: "Upload: osx-x64"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.APP_NAME }}-osx-x64-${{ env.TAG_NAME }}.zip
asset_name: ${{ env.APP_NAME }}-osx-x64-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip