Skip to content

Commit 8ec78ec

Browse files
authored
Merge pull request #9 from gui-cs/v2_update4519
2 parents 4ad2faa + 8a7399f commit 8ec78ec

File tree

6 files changed

+91
-29
lines changed

6 files changed

+91
-29
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,43 @@ name: Build and package
33
on: push
44

55
jobs:
6-
package:
7-
runs-on: ubuntu-20.04
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
job: [package-template, test-template]
12+
813
steps:
914
- uses: actions/checkout@v3
10-
- name: Build
11-
run: cd templates/basic && dotnet build
12-
- name: Pack
13-
run: dotnet pack
14-
- name: Publish to Nuget
15-
if: contains(github.ref, 'refs/tags/v')
16-
run: dotnet nuget push ./bin/Release/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
1715

16+
- name: Set up .NET
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: '8.x'
20+
21+
- name: Build and Package Template
22+
if: matrix.job == 'package-template'
23+
run: |
24+
cd templates/basic
25+
dotnet build
26+
dotnet pack --output ../../nupkgs
27+
28+
- name: Publish to NuGet
29+
if: matrix.job == 'package-template' && contains(github.ref, 'refs/tags/v')
30+
run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
31+
32+
- name: Test Template Install and Build
33+
if: matrix.job == 'test-template'
34+
run: |
35+
# Install the template locally
36+
dotnet new --install templates/basic
37+
38+
# Create a new project from the template
39+
mkdir testapp
40+
cd testapp
41+
dotnet new tui -n myproj
42+
cd myproj
43+
44+
# Build the generated project
45+
dotnet build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dotnet new --install Terminal.Gui.templates
1616
Version 2 of [Terminal.Gui](https://github.com/gui-cs/Terminal.Gui) is in alpha. To create projects using the v2 template you install the [latest version from nuget.org](https://www.nuget.org/packages/Terminal.gui.templates) e.g.
1717

1818
```
19-
dotnet new install Terminal.Gui.Templates::2.0.0-v2-develop.2203
19+
dotnet new install Terminal.Gui.Templates::2.0.0-v2-develop.4519
2020
```
2121

2222
## Creating projects

templates/basic/MyGuiCsProject.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Terminal.Gui" Version="2.0.0-v2-develop.2203" />
11+
<PackageReference Include="Terminal.Gui" Version="2.0.0-develop.4519" />
1212
</ItemGroup>
1313

1414
</Project>

templates/basic/MyView.Designer.cs

Lines changed: 39 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/basic/MyView.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@
33

44
// <auto-generated>
55
// This code was generated by:
6-
// TerminalGuiDesigner v1.0.17.0
6+
// TerminalGuiDesigner v2.0.0.0
77
// You can make changes to this file and they will not be overwritten when saving.
88
// </auto-generated>
99
// -----------------------------------------------------------------------------
10-
namespace MyGuiCsProject{
10+
namespace MyGuiCsProject {
1111
using Terminal.Gui;
1212

1313

1414
public partial class MyView {
1515

1616
public MyView() {
1717
InitializeComponent();
18-
button1.Accept += (s, e) => MessageBox.Query("Hello", "Hello There!", "Ok");
18+
19+
button1.Accepting += (s, e) =>
20+
{
21+
e.Handled = true;
22+
Terminal.Gui.Views.MessageBox.Query("Hello", "Hello There!", "Ok");
23+
};
1924
}
2025
}
2126
}

templates/basic/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
using MyGuiCsProject;
22
using Terminal.Gui;
3+
using Terminal.Gui.App;
4+
using Terminal.Gui.Drawing;
5+
using Terminal.Gui.Input;
6+
using Terminal.Gui.ViewBase;
7+
using Terminal.Gui.Views;
38

49
Application.Init();
510

0 commit comments

Comments
 (0)