Skip to content

Commit

Permalink
Merge pull request #3 from naseif/main
Browse files Browse the repository at this point in the history
Added workflow
  • Loading branch information
stho32 authored Jul 24, 2022
2 parents a5924d8 + 200185e commit 8ebbe95
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: build

on:
push:
pull_request:
branches: [main]

env:
DOTNET_VERSION: "6.0.x" # The .NET SDK version to use
SOLUTION_DIR: "optimalDb"
PROJECT: "./optimalDb.WinForms/optimalDb.WinForms.csproj"
RELEASEPREFIX: "optimalDb"

jobs:
build:
name: build-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
include:
- os: windows-latest
RUNTIMEID: win-x64
OUTPUTDIR: optimalDb-win-x64

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install dependencies
run: dotnet restore
working-directory: Source/${{ env.SOLUTION_DIR }}

- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: Source/${{ env.SOLUTION_DIR }}

- name: Test + Cover
run: ./update-coverage.sh

- name: Publish
run: dotnet publish ${{ env.PROJECT }} -c Release -o ${{matrix.OUTPUTDIR}} -p:PublishReadyToRun=true --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:UseAppHost=true -r ${{matrix.RUNTIMEID}}
working-directory: Source/${{ env.SOLUTION_DIR }}

- uses: vimtor/action-zip@v1
with:
files: ./Source/${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}/
dest: ${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip

0 comments on commit 8ebbe95

Please sign in to comment.