Update README.md #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |