-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (81 loc) · 3.65 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
name: Create Release
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Build Release
id: build_release
run: |
VERSION_FILE=${{ github.workspace }}/.version
VERSION=$(<"$VERSION_FILE")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_E=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
mkdir ./release
for RUNTIME in win-x86 win-x64 linux-x64 osx-x64; do
# Server
dotnet publish Arrowgene.Logging/Arrowgene.Logging.csproj --self-contained true /p:PublishTrimmed=true /p:Version=$VERSION /p:FromMSBuild=true --runtime $RUNTIME --configuration Release --output ./publish/$RUNTIME-$VERSION
# Pack
tar cjf ./release/$RUNTIME-$VERSION.tar.gz ./publish/$RUNTIME-$VERSION
done
- name: Publish NuGet
id: publish_nuget
run: |
dotnet pack Arrowgene.Logging/Arrowgene.Logging.csproj --output ../nupkgs /p:Version=${{ env.VERSION }}
curl -vX PUT -u "sebastian-heinz:${{ secrets.GITHUB_TOKEN }}" -F package=@../nupkgs/Arrowgene.Logging.${{ env.VERSION }}.nupkg https://nuget.pkg.github.com/sebastian-heinz/
dotnet nuget push ../nupkgs/Arrowgene.Logging.${{ env.VERSION }}.nupkg --source https://www.nuget.org/api/v2/package --api-key ${{ secrets.NUGET_DEPLOY_KEY }}
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release-${{ env.VERSION }}-${{ env.VERSION_E }}
release_name: Release ${{ env.VERSION }}-${{ env.VERSION_E }}
draft: false
prerelease: false
- name: Upload win-x86 Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/win-x86-${{ env.VERSION }}.tar.gz
asset_name: win-x86-${{ env.VERSION }}-${{ env.VERSION_E }}.tar.gz
asset_content_type: application/gzip
- name: Upload win-x64 Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/win-x64-${{ env.VERSION }}.tar.gz
asset_name: win-x64-${{ env.VERSION }}-${{ env.VERSION_E }}.tar.gz
asset_content_type: application/gzip
- name: Upload linux-x64 Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/linux-x64-${{ env.VERSION }}.tar.gz
asset_name: linux-x64-${{ env.VERSION }}-${{ env.VERSION_E }}.tar.gz
asset_content_type: application/gzip
- name: Upload osx-x64 Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/osx-x64-${{ env.VERSION }}.tar.gz
asset_name: osx-x64-${{ env.VERSION }}-${{ env.VERSION_E }}.tar.gz
asset_content_type: application/gzip