Skip to content

Commit

Permalink
build: auto publish to nuget on tag (#100)
Browse files Browse the repository at this point in the history
Signed-off-by: Shiwei Zhang <[email protected]>
  • Loading branch information
shizhMSFT authored Jan 15, 2024
1 parent dd70639 commit 8497bd0
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 10 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright The ORAS Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: release-nuget

on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up dotnet environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Extract Version
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Build nuget package
run: dotnet build ./src/OrasProject.Oras --configuration Release /p:PackageVersion=${{ steps.version.outputs.version }}
- name: Publish nuget package
run: dotnet nuget push ./src/OrasProject.Oras/bin/Release/OrasProject.Oras.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
19 changes: 12 additions & 7 deletions src/OrasProject.Oras/OrasProject.Oras.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
<PropertyGroup>
<TargetFramework>net8.0</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>
<PackageVersion>0.2.0-dev</PackageVersion>
<Authors>Oras Project</Authors>
<Description>Oras package provides API to work with OCI</Description>
<PackageTags>OCI, ORAS, Registry, Container, Image, Artifacts</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Copyright>Copyright (c) ORAS Project 2024</Copyright>
<PackageProjectUrl>https://oras.land</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/oras-project/oras-dotnet</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>OCI, ORAS, registry, container, image, artifact</PackageTags>
<PackageReleaseNotes>See https://github.com/oras-project/oras-dotnet/releases for details</PackageReleaseNotes>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -21,6 +26,6 @@
<PackageReference Include="System.Text.Json" Version="8.0.1" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="/" />
</ItemGroup>
<None Include="README.md" Pack="true" PackagePath="/" />
</ItemGroup>
</Project>
10 changes: 7 additions & 3 deletions src/OrasProject.Oras/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# About
# ORAS .NET library

Provides an implementation for working with [Open Container](https://opencontainers.org/)
images and artifacts .
`oras-dotnet` provides a .NET implementation `OrasProject.Oras` for working with [Open Container](https://opencontainers.org/) images and artifacts.

## Documentations

- [API Documentation](https://oras-project.github.io/oras-dotnet/api/): API Documentation for the ORAS .NET library.
- [oras.land/client_libraries](https://oras.land/client_libraries/): Documentation for general ORAS libraries.

0 comments on commit 8497bd0

Please sign in to comment.