Skip to content

Commit

Permalink
refactor: package publishing building blocks (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Sajay Antony <sajaya@microsoft.com>
  • Loading branch information
sajayantony authored Dec 21, 2023
1 parent d293a60 commit 47b5c41
Show file tree
Hide file tree
Showing 62 changed files with 61 additions and 17 deletions.
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
CONFIGURATION=Release

# Function to determine the version from Git and generate a SemVer 2.0 compliant version.
# Ensure you git tag with -a to annotate the tag with a message
get_version = $(shell \
TAG=$$(git describe --tags) && \
echo $$TAG | sed 's/^v//'; \
)

build:
dotnet build ./src/OrasProject.Oras --configuration $(CONFIGURATION)

test:
dotnet test ./tests/OrasProject.Oras.Tests --configuration $(CONFIGURATION)

pack:
$(eval VERSION := $(call get_version))
echo $(VERSION)
@if [ -z "$(VERSION)" ]; then \
dotnet pack ./src/OrasProject.Oras --configuration $(CONFIGURATION) --no-build -o nupkgs; \
else \
dotnet pack ./src/OrasProject.Oras --configuration $(CONFIGURATION) --no-build -o nupkgs /p:PackageVersion=$(VERSION); \
fi

clean:
dotnet clean ./src/OrasProject.Oras
dotnet clean ./tests/OrasProject.Oras.Tests

.PHONY: build test pack publish clean
4 changes: 2 additions & 2 deletions Oras.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oras.Tests", "Oras.Tests\Oras.Tests.csproj", "{70DFCE13-53AA-4CC2-8E1A-F73A1344A0CB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oras.Tests", "tests\OrasProject.Oras.Tests\Oras.Tests.csproj", "{70DFCE13-53AA-4CC2-8E1A-F73A1344A0CB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oras", "Oras\Oras.csproj", "{547F152F-6F4D-4E5A-AD3A-C3BC5CDCFD27}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrasProject.Oras", "src\OrasProject.Oras\OrasProject.Oras.csproj", "{547F152F-6F4D-4E5A-AD3A-C3BC5CDCFD27}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
14 changes: 0 additions & 14 deletions Oras/Oras.csproj

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions src/OrasProject.Oras/OrasProject.Oras.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<PackageId>OrasProject.Oras</PackageId>
<Version>0.0.0-dev</Version>
<RepositoryUrl>https://github.com/oras-project/oras-dotnet</RepositoryUrl>
<PackageProjectUrl>https://oras.land</PackageProjectUrl>
<Description>Oras package provides API to work with OCI</Description>
<PackageTags>OCI, ORAS, Registry, Container, Image, Artifacts</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>Oras.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="7.0.2" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="/"/>
</ItemGroup>
</Project>

4 changes: 4 additions & 0 deletions src/OrasProject.Oras/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# About

Provides an implementation for working with [Open Container](https://opencontainers.org/)
images and artifacts .
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Oras\Oras.csproj" />
<ProjectReference Include="..\..\src\OrasProject.Oras\OrasProject.Oras.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 47b5c41

Please sign in to comment.