Skip to content

Commit

Permalink
Create github workflow to automatically generate release nuget package (
Browse files Browse the repository at this point in the history
#9)

Creates a workflow that will automatically package IpmiFeaturePkg, generate release notes, and upload the nuget package to nuget.org.
  • Loading branch information
cfernald authored Sep 2, 2022
1 parent 6e988e7 commit 19d2bba
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 23 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## @file
# Release Package Action.
#
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

name: Build Release Package

on:
release:
types:
- published

env:
PACKAGE: IpmiFeaturePkg/
PACKAGE_DIR: _package/
NUSPEC_FILE: _package.nuspec
RELEASE_LOG: _package/release_log.txt

jobs:
build:
name: Build Release Package
runs-on: ubuntu-latest
environment: release
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Python Tools
run: pip install --upgrade -r pip-requirements.txt
- name: Prepare Release Files
run: |
mkdir -p ${{ env.PACKAGE_DIR }}
cp License.txt ${{ env.PACKAGE_DIR }}
cp -R ${{ env.PACKAGE }} ${{ env.PACKAGE_DIR }}
- name: Create Release Log
run: |
echo -------------------------------------------- > ${{ env.RELEASE_LOG}}
echo "Copyright (C) Microsoft Corporation" >> ${{ env.RELEASE_LOG}}
echo "SPDX-License-Identifier: BSD-2-Clause-Patent" >> ${{ env.RELEASE_LOG}}
echo -------------------------------------------- >> ${{ env.RELEASE_LOG}}
echo "Release: ${{ github.event.release.name }}" >> ${{ env.RELEASE_LOG}}
echo "Tag: ${{ github.event.release.tag_name }}" >> ${{ env.RELEASE_LOG}}
echo "Published: ${{ github.event.release.published_at }}" >> ${{ env.RELEASE_LOG}}
echo "URL: ${{ github.event.release.html_url }}" >> ${{ env.RELEASE_LOG}}
echo -------------------------------------------- >> ${{ env.RELEASE_LOG}}
echo "${{ github.event.release.body }}" >> ${{ env.RELEASE_LOG}}
- uses: nuget/setup-nuget@v1
with:
nuget-version: '6.x'
- name: Pack & Push Nuget Package
run: nuget-publish --Operation PackAndPush --ConfigFilePath nuget.config.yaml --Version ${{ github.event.release.tag_name }} --InputFolderPath ${{ env.PACKAGE_DIR }} --ApiKey ${{ secrets.NUGET_KEY }}
1 change: 1 addition & 0 deletions License.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Copyright (c) Microsoft Corporation.
Copyright (c) 2019, TianoCore and contributors. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down
58 changes: 35 additions & 23 deletions Readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
Project Mu IPMI Feature Repository
=================================

|NugetBuild| |NugetVersion|

============================= ================= =============== ===================
Host Type & Toolchain Build Status Test Status Code Coverage
============================= ================= =============== ===================
Windows_VS2022_ |WindowsCiBuild| |WindowsCiTest| |WindowsCiCoverage|
Ubuntu_GCC5_ |UbuntuCiBuild| |UbuntuCiTest| |UbuntuCiCoverage|
============================= ================= =============== ===================

This repository is part of Project Mu. Please see [Project Mu](https://microsoft.github.io/mu) for details.

This repository is part of Project Mu. Please see `Project Mu <https://microsoft.github.io/mu>`_ for details.

This IPMI feature repo contains the generic IPMI code from TianoCore's
edk2-platforms repo which has been refactored to support more general use and
Expand Down Expand Up @@ -42,17 +45,19 @@ desired.
{
"scope": "global",

"type": "git",
"type": "web",

"name": "FEATURE_IPMI",
"type": "nuget",

"var_name": "FEATURE_IPMI_PATH",
"name": "mu-feature-ipmi",

"source": "https://github.com/microsoft/mu_feature_ipmi.git",
"source": "https://api.nuget.org/v3/index.json",

"version": "<RELEASE HASH>",
"version": "<release version>",

"flags": ["set_build_var"]
"flags": ["set_build_var"],

"var_name": "IPMI_FEATURE_PATH"
}

Setting the the var_name and the set_build_var flags will allow the build scripts
Expand All @@ -62,45 +67,49 @@ configurations GetPackagesPath list.

shell_environment.GetBuildVars().GetValue("FEATURE_IPMI_PATH", "")

*Note: If using pytool extensions older then version 0.17.0 you will need to
append the root path to the build variable string.*

After this the package should be discoverable to can be used in the build like
any other dependency.

Releases Versions
=================

Releases of this repository will follow the `Nuget versioning
model <https://docs.microsoft.com/en-us/nuget/concepts/package-versioning>`_. This
will directly correspond to the version of the associated nuget package.

More Info
=========

Please see the Project Mu docs (<https://github.com/Microsoft/mu>) for more
Please see the `Project Mu docs <https://github.com/Microsoft/mu>`_ for more
information.

This project has adopted the [Microsoft Open Source Code of
Conduct](https://opensource.microsoft.com/codeofconduct/).
This project has adopted the `Microsoft Open Source Code of
Conduct <https://opensource.microsoft.com/codeofconduct/>`_.

For more information see the [Code of Conduct
FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact
[[email protected]](mailto:[email protected]) with any additional
For more information see the `Code of Conduct
FAQ <https://opensource.microsoft.com/codeofconduct/faq/>`_ or contact
`[email protected] <mailto:[email protected]>`_ with any additional
questions or comments.

Issues
======

Please open any issues in the Project Mu GitHub tracker. [More
Details](https://microsoft.github.io/mu/How/contributing/)
Please open any issues in the Project Mu GitHub tracker. `More
Details <https://microsoft.github.io/mu/How/contributing/>`_

## Contributing Code or Docs

Please follow the general Project Mu Pull Request process. [More
Details](https://microsoft.github.io/mu/How/contributing/)
Please follow the general Project Mu Pull Request process. `More
Details <https://microsoft.github.io/mu/How/contributing/>`_

* [Code Requirements](https://microsoft.github.io/mu/CodeDevelopment/requirements/)
* [Doc Requirements](https://microsoft.github.io/mu/DeveloperDocs/requirements/)
* `Code Requirements <https://microsoft.github.io/mu/CodeDevelopment/requirements/>`_
* `Doc Requirements <https://microsoft.github.io/mu/DeveloperDocs/requirements/>`_

Builds
======

Please follow the steps in the Project Mu docs to build for CI and local
testing. [More Details](https://microsoft.github.io/mu/CodeDevelopment/compile/)
testing. `More Details <https://microsoft.github.io/mu/CodeDevelopment/compile/>`_

Copyright & License
===================
Expand Down Expand Up @@ -176,3 +185,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.. |UbuntuCiBuild| image:: https://dev.azure.com/projectmu/mu/_apis/build/status/CI/Feature%20IPMI/Mu%20Feature%20IPMI%20-%20CI%20-%20GCC5?repoName=microsoft%2Fmu_feature_ipmi&branchName=main
.. |UbuntuCiTest| image:: https://img.shields.io/azure-devops/tests/projectmu/mu/98.svg
.. |UbuntuCiCoverage| image:: https://img.shields.io/badge/coverage-coming_soon-blue

.. |NugetBuild| image:: https://github.com/microsoft/mu_feature_ipmi/actions/workflows/release.yaml/badge.svg
.. |NugetVersion| image:: https://img.shields.io/nuget/v/mu-feature-ipmi
8 changes: 8 additions & 0 deletions nuget.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
author_string: Microsoft
copyright_string: Copyright (c) Microsoft Corporation
description_string: Project Mu IPMI Feature Package.
license_url: https://spdx.org/licenses/BSD-2-Clause-Patent.html
name: mu-feature-ipmi
project_url: https://github.com/microsoft/mu_feature_ipmi
server_url: https://api.nuget.org/v3/index.json
tags_string: ''

0 comments on commit 19d2bba

Please sign in to comment.