diff --git a/.github/workflows/cd-controls.yml b/.github/workflows/cd-controls.yml new file mode 100644 index 000000000000..aa93786ad99b --- /dev/null +++ b/.github/workflows/cd-controls.yml @@ -0,0 +1,82 @@ +# Copyright (c) 2024 Files Community +# Licensed under the MIT License. See the LICENSE. + +# Abstract: +# Deploys the Files UI Controls library to NuGet +# +# Workflow: +# 1. Restore and build Files UI Controls +# 2. Generate a NuGet package and symbols +# 3. Publish the artifacts to NuGet + +name: Files CD (UI Controls) + +on: + push: + branches: + - main + workflow_dispatch: + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: windows-latest + #environment: Deployments + strategy: + fail-fast: false + env: + SOLUTION_NAME: 'Files.sln' + CONFIGURATION: 'Release' # It's not necessary to use a matrix as the package method will always be Release + PLATFORM: 'x64' + WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\ + PROJECT_DIR: '${{ github.workspace }}\src\Files.App.Controls' + PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\Files.App.Controls\Files.App.Controls.csproj' + PACKAGE_MANIFEST_PATH: '${{ github.workspace }}\src\Files.App (Package)\Package.appxmanifest' + + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + - name: Setup NuGet + uses: NuGet/setup-nuget@v2 + - name: Setup .NET 8 + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + + - name: Use Windows SDK Preview + shell: cmd + run: | + for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt + + - name: Extract Version from Package.appxmanifest + id: extract_version + shell: pwsh + run: | + $xml = [xml](Get-Content $env:PACKAGE_MANIFEST_PATH) + $version = $xml.Package.Identity.Version + Write-Output "Found package version, $version" + echo "::set-output name=version::$version" + + - name: Restore NuGet + shell: pwsh + run: | + msbuild $env:PACKAGE_PROJECT_PATH ` + -t:Restore ` + -p:Platform=$env:PLATFORM ` + -p:Configuration=$env:CONFIGURATION ` + + - name: Build Files UI Controls + run: | + msbuild "$env:PACKAGE_PROJECT_PATH" ` + -t:Build ` + -p:Platform=$env:PLATFORM ` + -p:Configuration=$env:CONFIGURATION + + - name: Package Files UI Controls + run: dotnet pack ${{ env.PACKAGE_PROJECT_PATH }} --configuration Release --no-build -o ./output -p:Version=${{ steps.extract_version.outputs.version }} + + - name: Publish package to NuGet + run: dotnet nuget push ./output/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json diff --git a/src/Files.App.Controls/Files.App.Controls.csproj b/src/Files.App.Controls/Files.App.Controls.csproj index a1995d03b9cd..d904903e5726 100644 --- a/src/Files.App.Controls/Files.App.Controls.csproj +++ b/src/Files.App.Controls/Files.App.Controls.csproj @@ -15,6 +15,33 @@ true + + True + Files UI Controls + files-community + Files Community + Copyright (c) 2024 Files Community + README.md + https://github.com/files-community/Files + git + files, files-community, winui, winappsdk + Elevate your WinUI applications with our collection of custom-built controls, crafted specifically to address our needs in Files. These controls are provided "as is", with no guaranteed support, but we hope they prove useful to the developer community. + MIT + True + True + snupkg + + https://files.community + StoreLogo.scale-400.png + + + + + True + \ + + + @@ -26,4 +53,11 @@ + + + True + \ + + + diff --git a/src/Files.App.Controls/README.md b/src/Files.App.Controls/README.md new file mode 100644 index 000000000000..ff7a398dde9e --- /dev/null +++ b/src/Files.App.Controls/README.md @@ -0,0 +1,13 @@ +> These controls are provided "as is", with no guaranteed support, but we hope they prove useful to the developer community. + +# 📁 Files UI Controls + +##### Elevate your WinUI applications with our collection of custom-built controls, crafted specifically to address our needs in Files. + +--- + +This package contains various controls for the [Files app](https://files.community), including `ThemedIcon`, `Toolbar` and various storage controls. +It is available [on NuGet](https://www.nuget.org/packages/Files.App.Controls), however is unlisted and can only be installed by manually typing the package name and version number into the MSBuild project file. + +Please do not open issues on the Files repository about this package, as it is not officially supported by the Files team and is kept online for reference. +If you have questions about the design or implementation of these controls, please ask [on Discord](https://discord.gg/files).