Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
ISSUE-44-Migrate-to-github-actions (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanparvaresh authored Jul 22, 2021
1 parent b51fee8 commit 43f71bd
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 31 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Release"

on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'

- name: Set Release Version Env
run: echo "RELEASE_VERSION=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --no-restore --verbosity normal

- name: Pack
run: dotnet pack --no-build --configuration Release --include-symbols --include-source -p:PackageVersion=${RELEASE_VERSION:1} --output nupkgs

- name: release
run: dotnet nuget push ./nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_KEY}}
31 changes: 31 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Build and Test"

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ["5.0.x"]
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/[email protected]
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --no-restore --verbosity normal
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

9 changes: 7 additions & 2 deletions src/dotnet-exec.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<OutputType>Exe</OutputType>
<PackageId>dotnet-tool-exec</PackageId>
<PackageVersion>2.0.5</PackageVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>

<Description>Execute custom commands by dotnet</Description>
<PackageType>DotnetCliTool</PackageType>
<PackAsTool>true</PackAsTool>
<ToolCommandName>execute</ToolCommandName>
<PackageOutputPath>./../.nupkg</PackageOutputPath>
<PackageOutputPath>./../nupkgs</PackageOutputPath>
<AssemblyName>dotnet-exec</AssemblyName>

<IsPackable>true</IsPackable>
Expand All @@ -24,6 +25,10 @@
<RepositoryBranch>master</RepositoryBranch>
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
Expand Down
2 changes: 1 addition & 1 deletion test/ApplicationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void Should_Create_new_Config_File()
var result = app.Run(new string[] { "config-init" });

Assert.Equal(0, result);
Assert.Equal(fileSystem.fileName, "./.dotnetexec.json");
Assert.Equal("./.dotnetexec.json", fileSystem.fileName);

// should be parsable
var stream = fileSystem.OpenText("./.dotnetexec.json");
Expand Down
2 changes: 1 addition & 1 deletion test/dotnet-exec-test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down

0 comments on commit 43f71bd

Please sign in to comment.