Skip to content

Support the .NET 11 SDK band and net11.0-tizen TFMs #568

Support the .NET 11 SDK band and net11.0-tizen TFMs

Support the .NET 11 SDK band and net11.0-tizen TFMs #568

Workflow file for this run

name: Build Workload
on:
push:
branches:
- main
- net10.0
- net11.0
paths:
- 'workload/**'
- '.github/workflows/**'
pull_request:
branches:
- main
- net10.0
- net11.0
paths:
- 'workload/**'
- '.github/workflows/**'
workflow_dispatch:
inputs:
prerelease:
description: 'Pre-release tag name'
required: true
permissions:
contents: read
packages: read
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Authenticate GitHub Packages NuGet source
run: |
dotnet nuget update source github \
--username github-actions \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text \
--configfile workload/NuGet.config
# On a net11.0 branch (or a PR into one) .NET 11 is the product being built, so the
# workload must be built against the .NET 11 SDK rather than the Versions.props
# default. DotNet11SdkVersion in Versions.props is the single source of truth.
- name: Select target SDK band
id: sdk
run: |
TARGET_BRANCH="${{ github.base_ref || github.ref_name }}"
if [ "$TARGET_BRANCH" = "net11.0" ]; then
NET11=$(grep -oP '(?<=<DotNet11SdkVersion>)[^<]+' workload/build/Versions.props)
if [ -z "$NET11" ]; then
echo "::error::DotNet11SdkVersion not found in workload/build/Versions.props"
exit 1
fi
echo "dotnet_version=$NET11" >> "$GITHUB_OUTPUT"
echo "::notice ::Branch '$TARGET_BRANCH' builds against .NET 11 SDK $NET11"
else
echo "dotnet_version=" >> "$GITHUB_OUTPUT"
echo "::notice ::Branch '$TARGET_BRANCH' builds against the Versions.props default SDK band"
fi
- name: Build
env:
PULLREQUEST_ID: ${{ github.event.number }}
PRERELEASE_TAG: ${{ github.event.inputs.prerelease }}
DOTNET_VERSION: ${{ steps.sdk.outputs.dotnet_version }}
run: make test
working-directory: ./workload
- uses: actions/upload-artifact@v4
with:
name: tizen-workload-pkgs
path: ./workload/out/nuget-unsigned/*.nupkg
deploy:
runs-on: ubuntu-22.04
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Install libssl1.1
run: |
sudo apt-get update
sudo apt-get install -y wget
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb
- name: Install Github Package Registry Tool
run: dotnet tool install --global --no-cache gpr
- uses: actions/download-artifact@v4
with:
name: tizen-workload-pkgs
- name: Push packages to GPR
run: |
gpr push --api-key ${{ secrets.GITHUB_TOKEN }} \
--repository ${{ github.repository }} \
--retries 3 Samsung.*.nupkg
- name: Push packages to MyGet
run: |
dotnet nuget push Samsung.*.nupkg \
-k ${{ secrets.MYGET_APIKEY }} \
-s https://tizen.myget.org/F/dotnet/api/v2/package \
-t 3000