-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (65 loc) · 3.26 KB
/
dotnet.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d_%H%M')"
- name: Restore dependencies
run: dotnet restore -r linux-arm
- name: Build runtime required version
run: dotnet build --no-restore --no-self-contained -r linux-arm -c Release src/ReTerm/ReTerm.csproj
# - name: Test
# run: dotnet test --no-build --verbosity normal
- name: Zip artifact for runtime deployment
run: zip --junk-paths release-requires-dotnet-runtime.zip ./src/ReTerm/bin/Release/net6.0/linux-arm/* -r
- name: Build monolithic version
run: dotnet publish -r linux-arm --self-contained true -p:PublishSingleFile=true -p:PublishedTrimmed=true -p:PublishReadyToRun=true -p:Configuration=Release -p:IncludeAllContentForSelfExtract=true -p:PublishReadyToRunShowWarnings=true src/ReTerm/ReTerm.csproj
- name: Copy shell script to monolithic version output
run: cp src/ReTerm/ReTerm.sh ./src/ReTerm/bin/Release/net6.0/linux-arm/publish/
- name: Zip artifact for monolithic deployment
run: zip --junk-paths release-no-dotnet-runtime.zip ./src/ReTerm/bin/Release/net6.0/linux-arm/publish/* -r
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release_${{ steps.date.outputs.date }}
release_name: Release ${{ github.ref_name }} - ${{ steps.date.outputs.date }}
draft: false
prerelease: false
body: Latest automatically built release
- name: Upload Release Asset
id: upload-release-asset
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: ./release-requires-dotnet-runtime.zip
asset_name: release-requires-dotnet-runtime.zip
asset_content_type: application/zip
- name: Upload Release Asset
id: upload-release-asset-monolithic
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: ./release-no-dotnet-runtime.zip
asset_name: release-no-dotnet-runtime.zip
asset_content_type: application/zip