Skip to content

Commit 5acc505

Browse files
committed
build: add GitHub workflow
1 parent a84a08f commit 5acc505

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
File renamed without changes.

.github/workflows/build.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build .NET project
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v4
13+
14+
- name: Install .NET 8
15+
run: |
16+
curl -Lo dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/a91ddad4-a3c2-4303-9efc-1ca6b7af850c/be1763df9211599df1cf1c6f504b3c41/dotnet-sdk-8.0.405-linux-x64.tar.gz
17+
mkdir dotnet
18+
tar -C dotnet -xf dotnet.tar.gz
19+
rm dotnet.tar.gz
20+
echo DOTNET_ROOT=~/dotnet >> $GITHUB_ENV
21+
echo PATH=$PATH:~/dotnet >> $GITHUB_ENV
22+
23+
- name: Show version
24+
run: dotnet --version
25+
26+
- name: Clean build artifacts
27+
run: dotnet restore
28+
29+
- name: Build project
30+
run: dotnet build ZXBasicStudio.sln --configuration Release --no-restore
31+
32+
- name: Publish single executable
33+
run: |
34+
dotnet publish ZXBStudio/ZXBasicStudio.csproj -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -o out
35+
36+
- name: Pack files
37+
run: zip -9 -r ZXBasicStudio-linux-x64.zip ~/work/ZXBasicStudio/ZXBasicStudio/out/
38+
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
name: ZXBasicStudio-linux-x64
42+
path: ZXBasicStudio-linux-x64.zip

ZXBasicStudio.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HeadlessEmulator", "Headles
2929
EndProject
3030
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZXBasicStudioTest", "ZXBasicStudioTest\ZXBasicStudioTest.csproj", "{6A0F3D17-4AC4-43AC-BA18-2133D61D6F23}"
3131
EndProject
32+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{862E5205-9131-47CF-92B9-B0B89ACA6B28}"
33+
ProjectSection(SolutionItems) = preProject
34+
.github\workflows\build.yaml = .github\workflows\build.yaml
35+
EndProjectSection
36+
EndProject
3237
Global
3338
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3439
Debug|Any CPU = Debug|Any CPU

0 commit comments

Comments
 (0)