Skip to content

Commit 8ebbe95

Browse files
authored
Merge pull request #3 from naseif/main
Added workflow
2 parents a5924d8 + 200185e commit 8ebbe95

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: build
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [main]
7+
8+
env:
9+
DOTNET_VERSION: "6.0.x" # The .NET SDK version to use
10+
SOLUTION_DIR: "optimalDb"
11+
PROJECT: "./optimalDb.WinForms/optimalDb.WinForms.csproj"
12+
RELEASEPREFIX: "optimalDb"
13+
14+
jobs:
15+
build:
16+
name: build-${{matrix.os}}
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
os: [windows-latest]
21+
include:
22+
- os: windows-latest
23+
RUNTIMEID: win-x64
24+
OUTPUTDIR: optimalDb-win-x64
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Setup .NET Core
29+
uses: actions/setup-dotnet@v1
30+
with:
31+
dotnet-version: ${{ env.DOTNET_VERSION }}
32+
33+
- name: Install dependencies
34+
run: dotnet restore
35+
working-directory: Source/${{ env.SOLUTION_DIR }}
36+
37+
- name: Build
38+
run: dotnet build --configuration Release --no-restore
39+
working-directory: Source/${{ env.SOLUTION_DIR }}
40+
41+
- name: Test + Cover
42+
run: ./update-coverage.sh
43+
44+
- name: Publish
45+
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}}
46+
working-directory: Source/${{ env.SOLUTION_DIR }}
47+
48+
- uses: vimtor/action-zip@v1
49+
with:
50+
files: ./Source/${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}/
51+
dest: ${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip
52+
53+
- name: Release
54+
uses: softprops/action-gh-release@v1
55+
if: startsWith(github.ref, 'refs/tags/')
56+
with:
57+
files: |
58+
${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip

0 commit comments

Comments
 (0)