Skip to content

Commit

Permalink
Toolset deployment (#181)
Browse files Browse the repository at this point in the history
* Disabled unnecessary projects from packing

* Update Directory.Build.props

* Renamed projectfile

* Update Draco.sln

* Update Draco.ProjectTemplates.csproj

* Almost working

* Fix incorrect packaging

* package icon removed

* Create PackageIcon.png

* Update Directory.Build.props

* Create publish.yaml

* Update Draco.LanguageServer.csproj

* Update Directory.Build.props

Co-authored-by: John Tur <[email protected]>
  • Loading branch information
LPeter1997 and reflectronic authored Jan 16, 2023
1 parent f536fa0 commit b7386ff
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* text eol=lf
*.png binary
48 changes: 48 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Publish everything to NuGet

name: 'Publish packages'

on:
release:
types: [published]

env:
DOTNET_VERSION: '7.0.x' # The .NET SDK version to use
CONFIGURATION: 'Release' # The configuration to use
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}

jobs:
deployment:
runs-on: windows-latest
steps:
- name: Clone the repo
uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 18

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install dependencies
run: dotnet restore ./src

- name: Build
run: dotnet build ./src --configuration ${{ env.CONFIGURATION }} --no-restore

- name: Package
run: dotnet pack ./src /p:PackageReleaseNotes="See https://github.com/Draco-lang/Compiler/releases/tag/${{ github.event.release.tag_name }}"

- name: Upload to GitHub
uses: actions/upload-artifact@v2
with:
name: Draco
path: src/**/*${{ github.event.release.tag_name }}.nupkg

- name: Upload to NuGet.org
run: dotnet nuget push src/**/*${{ github.event.release.tag_name }}.nupkg --api-key ${{ env.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --no-symbols true
Binary file modified resources/PackageIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.0.1-alpha</Version>
<Version>0.1.0-pre</Version>
<DracoToolsTargetFramework>net7.0</DracoToolsTargetFramework>
</PropertyGroup>

Expand All @@ -10,7 +10,7 @@
<Authors>Draco-lang</Authors>
<Description>Compiler tools for the Draco programming language.</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageTags>Draco, compiler, language</PackageTags>
<PackageTags>Draco;compiler;language</PackageTags>
<Copyright>Copyright (c) 2023 Draco team</Copyright>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/Draco-lang/Compiler</RepositoryUrl>
Expand Down
1 change: 1 addition & 0 deletions src/Draco.Editor.Web/Draco.Editor.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<PublishTrimmed>false</PublishTrimmed>
<LangVersion>11</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Draco.LanguageServer/Draco.LanguageServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>11</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
19 changes: 0 additions & 19 deletions src/Draco.ProjectTemplates/Draco.ProjectTemplates.csproj

This file was deleted.

31 changes: 31 additions & 0 deletions src/Draco.ProjectTemplates/Draco.ProjectTemplates.msbuildproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.Build.NoTargets/3.7.0">

<PropertyGroup>
<PackageType>Template</PackageType>
<Description>Default Draco project templates.</Description>
<PackageTags>dotnet-new;templates;Draco</PackageTags>
<TargetFramework>netstandard2.0</TargetFramework>

<IncludeBuildOutput>false</IncludeBuildOutput>
<NoWarn>$(NoWarn);NU5128</NoWarn>

<!-- Workaround for project system bug -->
<DisableFastUpToDateCheck>false</DisableFastUpToDateCheck>
</PropertyGroup>

<Target Name="PackTemplatesWithReplacedVersion" BeforeTargets="Build">
<ItemGroup>
<_File Include="templates\**\*.*" />
</ItemGroup>

<WriteLinesToFile File="$(BaseIntermediateOutputPath)templates\%(_File.RecursiveDir)%(_File.Filename)%(_File.Extension)"
Lines="$([System.IO.File]::ReadAllText('%(_File.FullPath)').Replace('#{DRACO_VERSION}', '$(Version)'))"
Overwrite="true"
Encoding="UTF-8" />

<ItemGroup>
<None Include="$(BaseIntermediateOutputPath)templates\**\*.*" Pack="true" PackagePath="templates" />
</ItemGroup>
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"path": "./main.draco"
},
{
"path": "./DracoConsole.dracoproj"
"path": "./ConsoleApplication.dracoproj"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Draco.Sdk/1.0.0">
<Project Sdk="Draco.Sdk/#{DRACO_VERSION}">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>{TargetFramework}</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>11</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>11</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Draco.RedGreenTree/Draco.RedGreenTree.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>11</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions src/Draco.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Draco.Compiler.Tasks", "Dra
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Draco.Compiler.Toolset", "Draco.Compiler.Toolset\Draco.Compiler.Toolset.csproj", "{82765FD8-0985-475F-BDE6-3A27254FF457}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Draco.ProjectTemplates", "Draco.ProjectTemplates\Draco.ProjectTemplates.msbuildproj", "{61ED6EF8-D66C-42F4-AD8C-0AFFDA54D2C3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -104,6 +106,12 @@ Global
{82765FD8-0985-475F-BDE6-3A27254FF457}.Nuget|Any CPU.Build.0 = Debug|Any CPU
{82765FD8-0985-475F-BDE6-3A27254FF457}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82765FD8-0985-475F-BDE6-3A27254FF457}.Release|Any CPU.Build.0 = Release|Any CPU
{61ED6EF8-D66C-42F4-AD8C-0AFFDA54D2C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61ED6EF8-D66C-42F4-AD8C-0AFFDA54D2C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61ED6EF8-D66C-42F4-AD8C-0AFFDA54D2C3}.Nuget|Any CPU.ActiveCfg = Debug|Any CPU
{61ED6EF8-D66C-42F4-AD8C-0AFFDA54D2C3}.Nuget|Any CPU.Build.0 = Debug|Any CPU
{61ED6EF8-D66C-42F4-AD8C-0AFFDA54D2C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61ED6EF8-D66C-42F4-AD8C-0AFFDA54D2C3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit b7386ff

Please sign in to comment.