Files
Impostor/.github/workflows/deploy.yml
T
2020-09-21 03:36:32 +02:00

68 lines
2.6 KiB
YAML

name: Deploy
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
- name: Install dependencies
run: dotnet restore ./src
- name: Build Impostor.Client
run: dotnet build --no-restore -c Release -f netcoreapp3.1 ./src/Impostor.Client/Impostor.Client.csproj
- name: Build Impostor.Server
run: dotnet build --no-restore -c Release -f netcoreapp3.1 ./src/Impostor.Server/Impostor.Server.csproj
- name: Test
run: dotnet test --no-restore -v normal -f netcoreapp3.1 ./src
- name: Publish Impostor.Server (win-x64)
run: dotnet publish -c release -o ./build/win-x64 -f netcoreapp3.1 -r win-x64 --self-contained --no-restore ./src/Impostor.Server/Impostor.Server.csproj
- name: Zip Impostor.Server (win-x64)
run: cd ./build/win-x64; zip -r ../win-x64.zip .; cd ./../../
- name: Publish Impostor.Server (linux-x64)
run: dotnet publish -c release -o ./build/linux-x64 -f netcoreapp3.1 -r linux-x64 --self-contained --no-restore ./src/Impostor.Server/Impostor.Server.csproj
- name: Zip Impostor.Server (linux-x64)
run: cd ./build/linux-x64; zip -r ../linux-x64.zip .; cd ./../../
- 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 ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: true
prerelease: false
- name: Upload Release Asset (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: ./build/win-x64.zip
asset_name: Impostor-Server-win-x64.zip
asset_content_type: application/zip
- name: Upload Release Asset (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: ./build/linux-x64.zip
asset_name: Impostor-Server-linux-x64.zip
asset_content_type: application/zip