-
Notifications
You must be signed in to change notification settings - Fork 15
89 lines (86 loc) · 2.95 KB
/
ci-cd.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
name: CI/CD
on:
pull_request:
branches:
push:
branches: [ develop, master ]
tags:
- '*'
jobs:
build-and-test:
name: Buid and test application
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:6.0
steps:
- uses: actions/checkout@v2
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
build-linux-deb:
name: Build, Test and compile executable on Linux
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:6.0
needs: [build-and-test]
steps:
- uses: actions/checkout@v2
- name: Install dotnet deb
run: |
cd src/PlexRichPresence.UI.Avalonia
dotnet tool install --global dotnet-deb
export PATH="$PATH:/github/home/.dotnet/tools"
dotnet deb install
- name: Build deb package
run: |
cd src/PlexRichPresence.UI.Avalonia
export PATH="$PATH:/github/home/.dotnet/tools"
dotnet deb -c Release -f net6.0 -o dist/linux-x64
- name: Save deb package as artifact
uses: actions/upload-artifact@v2
with:
name: plex-rich-presence-deb
path: src/PlexRichPresence.UI.Avalonia/dist/linux-x64/
build-windows-installer:
name: Build, Test and publish executable on windows
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
needs: [build-and-test]
steps:
- uses: actions/checkout@v2
- name: Build Executable
run: cd src/PlexRichPresence.UI.Avalonia/ && dotnet publish --runtime win-x64 --configuration Release -p:PublishSingleFile=true --self-contained true --output C:\temp\plex-rich-presence
- name: Compile Installer
run: iscc installers/windows/installer.iss /dBuildNumber=${{github.run_number}} /dMyAppURL=https://github.com/${{github.repository}}
- name: Save Installer as Artifact
uses: actions/upload-artifact@v2
with:
name: plex-rich-presence-setup
path: C:\temp\plex-rich-presence\plex-rich-presence-setup.exe
create-release:
name: Create a release for with artifacts
needs: [build-and-test,build-linux-deb,build-windows-installer]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: plex-rich-presence-deb
path: linux
- uses: actions/download-artifact@v3
with:
name: plex-rich-presence-setup
path: windows
- name: Build
run: echo ${{ github.sha }} > Release.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
Release.txt
linux/PlexRichPresence.UI.Avalonia.*.deb
windows/plex-rich-presence-setup.exe