Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,43 @@ name: Build and package
on: push

jobs:
package:
runs-on: ubuntu-20.04
build:
runs-on: ubuntu-latest

strategy:
matrix:
job: [package-template, test-template]

steps:
- uses: actions/checkout@v3
- name: Build
run: cd templates/basic && dotnet build
- name: Pack
run: dotnet pack
- name: Publish to Nuget
if: contains(github.ref, 'refs/tags/v')
run: dotnet nuget push ./bin/Release/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json

- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'

- name: Build and Package Template
if: matrix.job == 'package-template'
run: |
cd templates/basic
dotnet build
dotnet pack --output ../../nupkgs

- name: Publish to NuGet
if: matrix.job == 'package-template' && contains(github.ref, 'refs/tags/v')
run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json

- name: Test Template Install and Build
if: matrix.job == 'test-template'
run: |
# Install the template locally
dotnet new --install templates/basic

# Create a new project from the template
mkdir testapp
cd testapp
dotnet new tui -n myproj
cd myproj

# Build the generated project
dotnet build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dotnet new --install Terminal.Gui.templates
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.

```
dotnet new install Terminal.Gui.Templates::2.0.0-v2-develop.2203
dotnet new install Terminal.Gui.Templates::2.0.0-v2-develop.4519
```

## Creating projects
Expand Down
2 changes: 1 addition & 1 deletion templates/basic/MyGuiCsProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Terminal.Gui" Version="2.0.0-v2-develop.2203" />
<PackageReference Include="Terminal.Gui" Version="2.0.0-develop.4519" />
</ItemGroup>

</Project>
54 changes: 39 additions & 15 deletions templates/basic/MyView.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions templates/basic/MyView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@

// <auto-generated>
// This code was generated by:
// TerminalGuiDesigner v1.0.17.0
// TerminalGuiDesigner v2.0.0.0
// You can make changes to this file and they will not be overwritten when saving.
// </auto-generated>
// -----------------------------------------------------------------------------
namespace MyGuiCsProject{
namespace MyGuiCsProject {
using Terminal.Gui;


public partial class MyView {

public MyView() {
InitializeComponent();
button1.Accept += (s, e) => MessageBox.Query("Hello", "Hello There!", "Ok");

button1.Accepting += (s, e) =>
{
e.Handled = true;
Terminal.Gui.Views.MessageBox.Query("Hello", "Hello There!", "Ok");
};
}
}
}
5 changes: 5 additions & 0 deletions templates/basic/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using MyGuiCsProject;
using Terminal.Gui;
using Terminal.Gui.App;
using Terminal.Gui.Drawing;
using Terminal.Gui.Input;
using Terminal.Gui.ViewBase;
using Terminal.Gui.Views;

Application.Init();

Expand Down
Loading