Skip to content

Remove actions for MAUI on Build and Release workflow (#484) #316

Remove actions for MAUI on Build and Release workflow (#484)

Remove actions for MAUI on Build and Release workflow (#484) #316

name: Build and Release
on:
push:
tags:
- 'v*'
env:
DOTNET_VERSION: 8.0.x
jobs:
build:
runs-on: windows-latest
outputs:
version: ${{ steps.set-version-to-output.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Update version number
shell: pwsh
run: |
$doc = [XML](Get-Content 'Source\Directory.Build.props')
$doc.Project.PropertyGroup.Version = '${{github.ref}}'.Split('/')[2].Substring(1)
$doc.Save('Source\Directory.Build.props')
- name: Set version to outputs
id: set-version-to-output
shell: pwsh
run: |
$doc = [XML](Get-Content 'Source\Directory.Build.props')
echo "version=$($doc.Project.PropertyGroup.Version)" >> $Env:GITHUB_OUTPUT
- name: Install dependencies
run: dotnet restore ReactiveProperty.sln
- name: Build
run: dotnet build ReactiveProperty.sln -c Release --no-restore /p:ContinuousIntegrationBuild=True /p:EmbedUntrackedSources=True
- name: Test
run: dotnet test ReactiveProperty.sln --no-restore --verbosity normal
- name: Copy package files
run: |
mkdir dist
Copy-Item (Get-ChildItem -Path "Source/**/*.nupkg" -Recurse) -Destination dist
Copy-Item (Get-ChildItem -Path "Source/**/*.snupkg" -Recurse) -Destination dist
shell: pwsh
- name: Archive NuGet packages
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
release-to-nuget:
runs-on: windows-latest
needs: build
steps:
- name: Download archives
uses: actions/download-artifact@v4
with:
name: dist
- name: Publish packages
run: dotnet nuget push **/*.nupkg --skip-duplicate -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json
create-release:
runs-on: windows-latest
needs: build
steps:
- name: Download archives
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "v${{ needs.build.outputs.version }}"
prerelease: ${{ contains(needs.build.outputs.version, '-pre') }}
title: Release ${{ needs.build.outputs.version }}
files: |
dist/*.nupkg