Skip to content

Commit 3033768

Browse files
authored
Create build.yml
1 parent 940c3f0 commit 3033768

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/build.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
on:
2+
push:
3+
4+
env:
5+
DOTNET_VERSION: "7.0.x" # The .NET SDK version to use
6+
SOLUTION_DIR: "LittleScriptBuddy"
7+
PROJECT: "./LittleScriptBuddy.Console/LittleScriptBuddy.Console.csproj"
8+
RELEASEPREFIX: "LittleScriptBuddy"
9+
10+
jobs:
11+
build:
12+
name: build-${{matrix.os}}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest]
17+
include:
18+
- os: ubuntu-latest
19+
RUNTIMEID: linux-x64
20+
OUTPUTDIR: lsb-linux-x64
21+
22+
- os: windows-latest
23+
RUNTIMEID: win-x64
24+
OUTPUTDIR: lsb-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: Set version number
38+
# run: ./Set-Version-Number.ps1 "1.${{github.run_number}}"
39+
# working-directory/: Scripts
40+
# shell: powershell
41+
42+
- name: Build
43+
run: dotnet build --configuration Release --no-restore
44+
working-directory: Source/${{ env.SOLUTION_DIR }}
45+
46+
# - name: Test + Cover
47+
# run: ./update-coverage.sh
48+
49+
- name: Publish
50+
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}}
51+
working-directory: Source/${{ env.SOLUTION_DIR }}
52+
53+
- uses: vimtor/action-zip@v1
54+
with:
55+
files: ./Source/${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}/
56+
dest: ${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip
57+
58+
- name: Release
59+
uses: softprops/action-gh-release@v1
60+
if: startsWith(github.ref, 'refs/tags/')
61+
with:
62+
files: |
63+
${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip

0 commit comments

Comments
 (0)