Skip to content

Commit

Permalink
Merge pull request #133 from nickvdyck/chore/build
Browse files Browse the repository at this point in the history
chore: redo build setup
  • Loading branch information
vandycknick authored Feb 22, 2020
2 parents 50fe438 + 4b85087 commit e805e5f
Show file tree
Hide file tree
Showing 25 changed files with 263 additions and 585 deletions.
6 changes: 0 additions & 6 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
"version": 1,
"isRoot": true,
"tools": {
"nuke.globaltool": {
"version": "0.24.0",
"commands": [
"nuke"
]
},
"minver-cli": {
"version": "2.0.0",
"commands": [
Expand Down
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml,json,csproj}]
[*.{yml,json,csproj,props,targets}]
indent_size = 2

[.babelrc]
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v1

- name: Restore Tools
run: dotnet tool restore

- name: Install dependencies
run: dotnet nuke setup
run: make setup

- name: Lint
run: make lint

- name: Package app
run: dotnet nuke
- name: Build & Package
run: make

- name: Get the version
id: get_version
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,17 @@ jobs:
- name: Checkout code
uses: actions/checkout@v1

- name: Restore Tools
run: dotnet tool restore

- name: Install dependencies
run: dotnet nuke setup
run: make setup

- name: Lint
run: dotnet nuke lint
run: make lint

- name: Build & Package
run: dotnet nuke

- name: Unit Test Client
run: yarn --cwd src/WebTty.Hosting/Client/ test --coverage --coverageDirectory ../../../.tmp/webtty.hosting/client
run: make

- name: Unit Test Server
run: dotnet nuke test
- name: Test
run: make test

- name: Codecov Upload Coverage
uses: codecov/codecov-action@v1
Expand Down
1 change: 0 additions & 1 deletion .nuke

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>

<Import Project="BuildOutput.props" />
<Import Project="Common.props" />

<PropertyGroup>
<Authors>Nick Van Dyck</Authors>
Expand All @@ -25,7 +25,7 @@

<IsPackaging>false</IsPackaging>
<RestoreSources Condition="'$(IsPackaging)' == 'true'">
$(RestoreSources);../../artifacts;https://api.nuget.org/v3/index.json
$(MSBuildThisFileDirectory)artifacts;$(RestoreSources);https://api.nuget.org/v3/index.json
</RestoreSources>

<MinVerAutoIncrement>minor</MinVerAutoIncrement>
Expand Down
91 changes: 91 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.PHONY: purge clean default install uninstall setup test
.DEFAULT_GOAL := default

ARTIFACTS := $(shell pwd)/artifacts
BUILD := $(shell pwd)/.build
TEMP := $(shell pwd)/.tmp
CONFIGURATION := Release
WEBTTY_EXEC := src/WebTty.Exec/WebTty.Exec.csproj
WEBTTY_CLIENT := src/WebTty.Hosting/Client
CLI_PROJECT := src/WebTty/WebTty.csproj
CLI_TOOL := webtty
RUNTIME := linux-x64

purge:
rm -rf $(BUILD)
rm -rf $(ARTIFACTS)
rm -rf $(TEMP)

clean:
rm -rf $(ARTIFACTS)
dotnet clean

restore:
dotnet restore
dotnet tool restore

setup: restore
dotnet run --project tools/jsonschema/jsonschema.csproj
dotnet build -c $(CONFIGURATION)

default:
$(MAKE) package

package: restore package-exec
dotnet restore --force-evaluate
dotnet build -c $(CONFIGURATION) /property:IsPackaging=True $(CLI_PROJECT)
dotnet pack $(CLI_PROJECT) --configuration $(CONFIGURATION) \
--no-build \
--output $(ARTIFACTS) \
--include-symbols

package-exec:
dotnet pack $(WEBTTY_EXEC) \
--configuration $(CONFIGURATION) \
--output $(ARTIFACTS) \
--version-suffix build.$(shell date "+%Y%m%d%H%M%S")

package-native:
dotnet publish $(CLI_PROJECT) -c $(CONFIGURATION) \
--output $(BUILD)/publish/$(RUNTIME) \
--runtime $(RUNTIME) \
/property:PublishTrimmed=true \
/property:PublishSingleFile=true

@mkdir -p $(ARTIFACTS)
@cp $(BUILD)/publish/$(RUNTIME)/$(CLI_TOOL) $(ARTIFACTS)/$(CLI_TOOL).$(RUNTIME)

package-osx:
$(MAKE) package-native RUNTIME=osx-x64

install:
dotnet tool install --global --add-source $(ARTIFACTS) \
--version $$(dotnet minver -t v -a minor -v e) \
$(CLI_TOOL)

uninstall:
dotnet tool uninstall --global $(CLI_TOOL)

lint: types
yarn --cwd $(WEBTTY_CLIENT) lint

types:
yarn --cwd $(WEBTTY_CLIENT) tsc --noEmit

test:
yarn --cwd $(WEBTTY_CLIENT) test --coverage --coverageDirectory $(TEMP)/webtty.hosting/client

dotnet test test/WebTty.Test/WebTty.Test.csproj -c Release \
/property:CollectCoverage=true \
/property:CoverletOutputFormat=lcov \
/property:CoverletOutput=$(TEMP)/webtty.test/lcov.info

dotnet test test/WebTty.Api.Test/WebTty.Api.Test.csproj -c Release \
/property:CollectCoverage=true \
/property:CoverletOutputFormat=lcov \
/property:CoverletOutput=$(TEMP)/webtty.api.test/lcov.info

dotnet test test/WebTty.Integration.Test/WebTty.Integration.Test.csproj -c Release \
/property:CollectCoverage=true \
/property:CoverletOutputFormat=lcov \
/property:CoverletOutput=$(TEMP)/webtty.integration.test/lcov.info
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,24 @@ dotnet tool install -g webtty
```
λ webtty --help
🔌 WebSocket based terminal emulator
webtty:
🔌 Simple command-line tool for sharing a terminal over the web.
Usage: webtty [options] -- [command] [<arguments...>]
Usage:
webtty [options] [[--] <additional arguments>...]]
Options:
-a, --address=VALUE IP address to use [localhost]. Use any to listen
to any available address. Ex (0.0.0.0, any, 192.
168.2.3, ...)
-s, --unix-socket=VALUE Use the given Unix domain socket path for the
server to listen to
-p, --port=VALUE Port to use [5000]. Use 0 for a dynamic port.
--path=VALUE Path to use, defaults to /tty
--version Show current version
-?, -h, --help Show help information
-a, --address <address> IP address to use [localhost]. Use any to listen to any available
address. Ex (0.0.0.0, any, 192.168.2.3, ...).
-s, --unix-socket <filepath> Use the given Unix domain socket path for the server to listen to
-p, --port <port> Port to use [5000]. Use 0 for a dynamic port.
--path <path> Path to use, defaults to /pty
--theme <theme> Theme to use, uses a simple black theme by default
--version Show version information
-?, -h, --help Show help and usage information
Additional Arguments:
Arguments passed to the application that is being run.
```

[ci-url]: https://github.com/nickvdyck/webtty
Expand Down
68 changes: 0 additions & 68 deletions build.ps1

This file was deleted.

62 changes: 0 additions & 62 deletions build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/WebTty.Api/WebTty.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup Condition="'$(IsPackaging)' == 'true'">
<PackageReference Include="WebTty.Exec" Version="0.1.0-build.*" Pack="true" />
<PackageReference Include="WebTty.Exec" Version="1.0.0-build.*" Pack="true" />
</ItemGroup>

<ItemGroup Condition="'$(IsPackaging)' == 'false'">
Expand Down
7 changes: 5 additions & 2 deletions src/WebTty.Exec/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<Project>

<Import Project="Version.props" />
<Import Project="../../BuildOutput.props" />
<Import Project="../../Common.props" />

<PropertyGroup>
<LangVersion>latest</LangVersion>
<RootNamespace>WebTty.Exec</RootNamespace>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<AssemblyName>WebTty.Exec</AssemblyName>

<VersionPrefix>1.0.0</VersionPrefix>
<PackageVersion>$(VersionPrefix)</PackageVersion>
<PackageVersion Condition="'$(VersionSuffix)' != ''">$(PackageVersion)-$(VersionSuffix)</PackageVersion>
</PropertyGroup>

</Project>
8 changes: 0 additions & 8 deletions src/WebTty.Exec/Version.props

This file was deleted.

Loading

0 comments on commit e805e5f

Please sign in to comment.