Skip to content

Commit

Permalink
Added GithubActions config
Browse files Browse the repository at this point in the history
  • Loading branch information
ChernyshevDS92 committed Aug 10, 2020
1 parent a0bca70 commit 2a2c1e6
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/dotnet-core-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: .NET Core Desktop

on:
push:
branches: [ master ]
tags:
- '*'

jobs:
build:
runs-on: windows-latest

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
Solution_Name: ImageSim.sln
Test_Project_Path: Tests\Tests.csproj

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101

- name: Restore
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration Release

- name: Execute unit tests
run: dotnet test --no-build --configuration Release

- name: Make release archive
shell: bash
run: |
git fetch --prune --unshallow --tags
tag=$(git describe --always)
release_name="ImageSim-$tag-win-x64"
dotnet publish ImageSim/ImageSim.csproj --runtime win-x64 -c Release -o ${release_name} --self-contained=false //p:CopyOutputSymbolsToPublishDirectory=false //p:DebugType=None
find $release_name -type f -name '*.pdb' -exec rm {} +
7z a -tzip "ImageSim-win-x64.zip" "./${release_name}/*"
rm -r "$release_name"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Publish
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 }}
asset_path: "ImageSim-win-x64.zip"
asset_name: ImageSim-win-x64.zip
asset_content_type: application/zip

0 comments on commit 2a2c1e6

Please sign in to comment.