Browse Source

attempting new publish technique

Charlie Kindel 4 years ago
parent
commit
906939874b

+ 26 - 10
.github/workflows/publish.yml

@@ -1,12 +1,15 @@
-name: publish Terminal.Gui to nuget
+name: Publish Terminal.Gui to nuget
 on:
   push:
-    branches:
-      - master # Default release branch
+    tags:
+      - v*
+
 jobs:
+
   publish:
     name: build, pack & publish
     runs-on: ubuntu-latest
+
     steps:
       - uses: actions/checkout@v2
         with:
@@ -17,11 +20,24 @@ jobs:
         with:
           dotnet-version: 5.0.100
 
-      # Publish
-      - name: publish on version change
+      - name: minver-cli
+        run: |
+          dotnet tool install --global minver-cli --version 2.4.0
+          echo "MINVERVERSIONOVERRIDE=$(minver -t v -d rc)" >> $GITHUB_ENV
+
+      - name: Install dependencies
+        run: dotnet restore
+
+      - name: Build
+        run: dotnet build --configuration Release --no-restore
+      
+      - name: Publish Terminal.Gui
         id: publish_nuget
-        uses: brandedoutcast/publish-nuget@v2
+        uses: brandedoutcast/publish-nuget@v2.5.5
         with:
+          VERSION_STATIC: ${{ env.MINVERVERSIONOVERRIDE }}
+          NUGET_SOURCE: https://api.nuget.org
+
           # Filepath of the project to be packaged, relative to root of repository
           PROJECT_FILE_PATH: Terminal.Gui/Terminal.Gui.csproj
           
@@ -29,16 +45,16 @@ jobs:
           PACKAGE_NAME: Terminal.Gui
           
           # Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH
-          VERSION_FILE_PATH: Terminal.Gui/Directory.Build.props
+          #VERSION_FILE_PATH: Terminal.Gui/Directory.Build.props
 
           # Regex pattern to extract version info in a capturing group
-          VERSION_REGEX: ^\s*<Version>(.*)<\/Version>\s*$
+          #VERSION_REGEX: ^\s*<Version>(.*)<\/Version>\s*$
           
           # Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX
           # VERSION_STATIC: 1.0.0
 
           # Flag to toggle git tagging, enabled by default
-          TAG_COMMIT: true
+          TAG_COMMIT: false
 
           # Format of the git tag, [*] gets replaced with actual version
           # TAG_FORMAT: v*
@@ -50,4 +66,4 @@ jobs:
           # NUGET_SOURCE: https://api.nuget.org
 
           # Flag to toggle pushing symbols along with nuget package to the server, disabled by default
-          INCLUDE_SYMBOLS: false
+          INCLUDE_SYMBOLS: true

+ 1 - 20
Terminal.Gui/Directory.Build.props

@@ -3,26 +3,7 @@
   <PropertyGroup>
     <!--
        Version info for Terminal.Gui is managed by MinVer (https://github.com/adamralph/minver)
-       
-       - To release a new version simply tag at commit
-
-      git tag major.minor.patch.build.height
-      
-      // patch can indicate pre-release or not
-
-       e.g: 
-       
-       git tag 1.3.4-beta.5
-       
-          or
-       
-       git tag 2.3.4.5
-       
-       Then build.
-       
-       - When the .revision changes a new nuget package will be generated when a PR is merged to master as part of CI/CD.
-
-       - Miguel can hide defunct/old nuget packages.
+       See Terminal.Gui/README.md for more info.
     -->
     <Authors>Miguel de Icaza, Charlie Kindel (@tig), @BDisp</Authors>
   </PropertyGroup>

+ 36 - 0
Terminal.Gui/README.md

@@ -20,6 +20,42 @@ Contains all files required to build the **Terminal.Gui** library (and nuget pac
 - `Views/` - A folder (not namespace) containing the source for all built-in classes that drive from `View` (non-modals). 
 - `Windows/` - A folder (not namespace) containing the source all built-in classes that derive from `Window`.
 
+## Version numbers
+
+Version info for Terminal.Gui is managed by MinVer (https://github.com/adamralph/minver).
+
+To release a new version simply tag a commit
+
+```powershell
+git tag major.minor.patch.build.height
+```      
+
+`patch` can indicate pre-release or not
+
+e.g: 
+       
+```powershell
+git tag 1.3.4-beta.5
+```
+
+    or
+       
+```powershell
+git tag 2.3.4.5
+```       
+
+Then rebuild the project and the version info will be updated.
+
+## Nuget
+
+https://www.nuget.org/packages/Terminal.Gui
+
+When the `.patch` changes a new nuget package will be generated when the PR is merged to master as part of CI/CD.
+
+If the version is pre-release (includes a hyphen, e.g. `1.3.4-beta.5`) the Nuget package will be tagged as pre-release.
+
+Miguel can hide defunct/old nuget packages.
+
 ## Contributing
 
 See [CONTRIBUTING.md](https://github.com/migueldeicaza/gui.cs/blob/master/CONTRIBUTING.md).

+ 4 - 17
Terminal.Gui/Terminal.Gui.csproj

@@ -5,15 +5,10 @@
     <AssemblyName>Terminal.Gui</AssemblyName>
     <DocumentationFile>bin\Release\Terminal.Gui.xml</DocumentationFile>
     <GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
-    <!-- moved to ../Directory.Build.props -->
-    <!-- <AssemblyVersion>0.89.0.0</AssemblyVersion> -->
   </PropertyGroup>
   <PropertyGroup>
     <GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
     <PackageId>Terminal.Gui</PackageId>
-    <!-- moved to ../Directory.Build.props -->
-    <!-- <PackageVersion>0.89</PackageVersion> -->
-    <!-- <Authors>Miguel de Icaza, Charlie Kindel (@tig), @BDisp</Authors> -->
     <PackageLicenseExpression>MIT</PackageLicenseExpression>
     <PackageProjectUrl>https://github.com/migueldeicaza/gui.cs/</PackageProjectUrl>
     <PackageTags>csharp, terminal, c#, f#, gui, toolkit, console</PackageTags>
@@ -22,6 +17,10 @@
     <Summary>Application framework for creating modern console applications using .NET</Summary>
     <Title>Terminal.Gui is a framework for creating console user interfaces</Title>
     <PackageReleaseNotes>
+      v1.0.0-beta.1
+      * Now using MinVer to generate version numbers from git tags.
+      * Updated publish-to-nuget to work with minver
+      
       v1.0.0-pre.9
       * NEW CONTROL: TreeView - Thanks @tznind!
       * Fixes #1066. View sizing across the various terminals has been fixed; works in Windows Terminal again - thanks @bdisp
@@ -189,13 +188,6 @@
     <DefineConstants>TRACE;DEBUG_IDISPOSABLE</DefineConstants>
   </PropertyGroup>
 
-  <!--<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net472|AnyCPU'">
-    <DefineConstants>TRACE</DefineConstants>
-  </PropertyGroup>
-
-  <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net472|AnyCPU'">
-    <DefineConstants>TRACE;DEBUG_IDISPOSABLE</DefineConstants>
-  </PropertyGroup>-->
   <ItemGroup>
     <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="true" />
     <PackageReference Include="NStack.Core" Version="0.16.0" />
@@ -203,11 +195,6 @@
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
     </PackageReference>  </ItemGroup>
-  <!--<ItemGroup>
-    <Reference Include="NStack">
-      <HintPath>..\..\..\Users\miguel\.nuget\packages\nstack.core\0.14.0\lib\netstandard2.0\NStack.dll</HintPath>
-    </Reference>
-  </ItemGroup>-->
   <ItemGroup>
     <None Remove="ConsoleDrivers\#ConsoleDriver.cs#" />
   </ItemGroup>