Skip to content

Commit

Permalink
feat(ci): test publish ci
Browse files Browse the repository at this point in the history
feat(ci): add required fields for Nuget package

feat(ci): only publish actual library

fix(ci): include packageversion property

fix(ci): better version exporting

fix(ci): even simpler version variable

chore(ci): test workflow while i figure out what is wrong

bash maybe?

fix(ci): use bash for all run steps

fix(ci): go into project directory before building

run test workflow so i stop making build

a

a

lets try this

lets try dashes

a

I'll squash this later

remove project file from pack command

try manually specificying the version

try suggestion from github

prefix packageid with companyname

tidy up
  • Loading branch information
ProbablePrime committed Oct 28, 2023
1 parent 251344d commit 6f4436b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Library

# When a release is published
on:
release:
types: [published]
jobs:
build:
# 2019, has our .NET needs, latest does not
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Get version
run: |
echo "VERSION=${{ github.event.release.tag_name }}" >> $env:GITHUB_ENV
echo "Building with ${{ env.VERSION }}"
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore -p:Version=${{ env.VERSION }}
- name: Pack
run: dotnet pack Elements.Quantity --output nupkgs --configuration Release -p:Version=${{ env.VERSION }}
- name: Nuget Publish
run: dotnet nuget push nupkgs/*.nupkg -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Whatever

on:
push:
paths-ignore:
- '**/*.md'
branches:
- main
jobs:
build:
# 2019, has our .NET needs, latest does not
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
# While this package targets .Net Framework 4.6.2, the dotnet 7 stuff will work.
- name: Get version
run: |
echo "VERSION=7" >> $env:GITHUB_ENV
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore -p:Version=${{ env.VERSION }}
- name: Pack
run: dotnet pack Elements.Quantity --output nupkgs --configuration Release -p:Version=${{ env.VERSION }} -p:PackageVersion=${{ env.VERSION }}
10 changes: 7 additions & 3 deletions Elements.Quantity/Elements.Quantity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7DA9B41E-A0F0-4392-8672-966642C94884}</ProjectGuid>
<Company>Yellow Dog Man Studios</Company>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Elements.Quantity</RootNamespace>
<AssemblyName>Elements.Quantity</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<TargetFrameworkProfile></TargetFrameworkProfile>

<Company>Yellow Dog Man Studios</Company>
<Authors>Yellow Dog Man Studios</Authors>
<PackageId>YellowDogMan.Elements.Quantity</PackageId>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -38,6 +40,8 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<!-- Needed to release, not included in build -->
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="6.7.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Compile Include="Core\CompoundFormatInfo.cs" />
Expand Down

0 comments on commit 6f4436b

Please sign in to comment.