Skip to content

Commit

Permalink
Package C# SDK .nupkg in release artifacts
Browse files Browse the repository at this point in the history
Signed-off-by: Danilo Del Busso <[email protected]>
  • Loading branch information
danilo-delbusso committed Feb 7, 2024
1 parent def9015 commit 6de5b11
Showing 1 changed file with 49 additions and 3 deletions.
52 changes: 49 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ name: Create release from tag
on:
push:
tags:
- 'v*'
- "v*"

jobs:
build-python:
name: Build and upload Python artifacts
runs-on: ubuntu-latest

steps:
Expand All @@ -16,7 +17,7 @@ jobs:
- name: Use python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: "3.x"

- name: Install build dependencies
run: |
Expand All @@ -34,17 +35,62 @@ jobs:
name: XenAPI
path: scripts/examples/python/dist/

build-sdks:
name: Build and upload SDK artifacts
runs-on: ubuntu-latest
env:
XAPI_VERSION: ${{ github.ref_name }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup XenAPI environment
uses: ./.github/workflows/setup-xapi-environment
with:
xapi_version: ${{ env.XAPI_VERSION }}

- name: Generate and build SDKs
uses: ./.github/workflows/generate-and-build-sdks
with:
xapi_version: ${{ env.XAPI_VERSION }}

- name: Store C# SDK distribution artifacts
uses: actions/upload-artifact@v3
with:
name: XenServer.NET
path: _build/install/default/xapi/sdk/csharp/src/bin/Release/*-prerelease-unsigned.nupkg

- name: Uninstall unversioned packages and remove pins
# This should purge them from the cache, unversioned package have
# 'master' as its version
run: |
opam list | awk -F " " '$2 == "master" { print $1 }' | xargs opam uninstall
opam pin list | cut -f1 -d "." | xargs opam unpin
release:
name: "Create and package release"
runs-on: ubuntu-latest
needs: build-python
needs: [build-python, build-sdks]
steps:
- name: Retrieve python distribution artifacts
uses: actions/download-artifact@v3
with:
name: XenAPI
path: dist/

- name: Retrieve Python SDK distribution artifacts
uses: actions/download-artifact@v3
with:
name: XenAPI
path: dist/

- name: Retrieve C# SDK distribution artifacts
uses: actions/download-artifact@v3
with:
name: XenServer.NET
path: dist/

- name: Create release ${{ github.ref_name }}
run: gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --generate-notes dist/*
env:
Expand Down

0 comments on commit 6de5b11

Please sign in to comment.