-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Controls: Added metadata to the Controls project to enable publishing to NuGet #16611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Lamparter
wants to merge
57
commits into
files-community:main
Choose a base branch
from
Lamparter:nupkg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
6d566b7
Add package metadata
Lamparter 371f28b
Add package README
Lamparter f69df1d
New package description
Lamparter bd148fd
Change package description in README
Lamparter ae0a712
Change authors to just "files-community"
Lamparter 74cf1f1
Initial addition of CI
Lamparter 55b2a56
Add PR run for CI to test
Lamparter e4d1896
Update cd-controls.yml
Lamparter 32bd9c6
Update cd-controls.yml
Lamparter 1ef3957
Fix version script
Lamparter af8c126
Fix appxpackage reference
Lamparter 7c207f2
Fix reference to UI controls project
Lamparter 6f1583c
Update cd-controls.yml
Lamparter 089990a
Update cd-controls.yml
Lamparter 9e8992b
Move comma
Lamparter b37ab4e
Move comma in `README.md`
Lamparter 3949f43
Add more tags
Lamparter de9eb16
Replace secret direct link with placeholder
Lamparter f0b0bda
Update license header
Lamparter a3ad397
Rename potential deployment space to "NuGet"
Lamparter 25a5501
Remove accidental space
Lamparter 4b75ccf
Replace tab formatting with spaces
Lamparter 744ab9d
Include README via `Include=` rather than `Update=`
Lamparter a8a757e
Add versioning file
Lamparter ed56c28
Remove 'extract version' step
Lamparter a0dc89f
Reference version in project
Lamparter bc1aab5
New workflow
Lamparter 6f86b54
Add PR creation step
Lamparter 7539ba2
Remove ``
Lamparter 15437ed
Remove `--body`
Lamparter 6635231
`""` > `''`
Lamparter b7e23da
`GH_TOKEN`
Lamparter d16e0c1
Example
Lamparter ef8140a
Sample bot
Lamparter 0414517
Fix custom actor
Lamparter cb632a5
Improve message
Lamparter e65e342
Change PR prefix
Lamparter 1b0a7c5
Remove CLI newline switch
Lamparter 7309b90
Update copyright year
Lamparter 6ae0c0d
Reword warning
Lamparter 84b1b68
Update to SLNX
Lamparter d708c17
Merge steps
Lamparter cd67173
Update .github/workflows/bump-controls.yml
Lamparter 11de1fa
Set environment to NuGet
Lamparter 954223e
Only run the CD workflow when CurrentVersion.props gets edited
Lamparter f7264e6
Only run the Bump Controls action on manual trigger
Lamparter 85c8344
Change repo owner check to `files-community`
Lamparter a9b0470
Update .github/workflows/bump-controls.yml
Lamparter 47a23c5
Actual secret
Lamparter 4f5e7fe
Rename environment
Lamparter 1338cf5
Rename action
Lamparter 0784f2d
Space
Lamparter cd8d9a5
Update .github/workflows/bump-controls.yml
yaira2 d463b58
Remove unnecessary comments
Lamparter 3e218fc
Rename `PROPS_PATH` to `VERSION_PROPS_PATH`
Lamparter 0f0f4b8
Nitpick
Lamparter f45cecb
URGENT FIX
Lamparter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Copyright (c) Files Community | ||
# Licensed under the MIT License. | ||
|
||
# Abstract: | ||
# Bumps the version of the Files UI Controls library | ||
# | ||
# Workflow: | ||
# 1. Find the version of the Files UI Controls library | ||
# 2. Bump the version of the Files UI Controls library | ||
# 3. Commit the changes to a new branch in the repo | ||
# 4. Push the changes to the repo | ||
# 5. Create a pull request and request a review | ||
|
||
name: Bump Files.App.Controls | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
bump: | ||
runs-on: windows-latest | ||
environment: Pull Requests | ||
strategy: | ||
fail-fast: false | ||
env: | ||
WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\ | ||
VERSION_PROPS_PATH: '${{ github.workspace }}\src\Files.App.Controls\CurrentVersion.props' | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate GitHub Apps token | ||
if: github.repository_owner == 'files-community' | ||
id: generate | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ secrets.BOT_APP_ID }} | ||
private-key: ${{ secrets.BOT_PRIVATE_KEY }} | ||
|
||
- name: Bump Version | ||
id: bump_version | ||
shell: pwsh | ||
run: | | ||
$xml = [xml](Get-Content $env:PROPS_PATH) | ||
$version = [int]$xml.Project.PropertyGroup.MicroVersion | ||
$newVersion = $version + 1 | ||
$xml.Project.PropertyGroup.MicroVersion = $newVersion | ||
$xml.Save($env:PROPS_PATH) | ||
Write-Output "Bumped version to $newVersion" | ||
echo "::set-output name=new_version::$newVersion" | ||
|
||
- name: Get version for PR message | ||
id: get_version | ||
shell: pwsh | ||
run: | | ||
$xml = [xml](Get-Content $env:PROPS_PATH) | ||
$microVersion = [int]$xml.Project.PropertyGroup.MicroVersion | ||
$minorVersion = [int]$xml.Project.PropertyGroup.MinorVersion | ||
$majorVersion = [int]$xml.Project.PropertyGroup.MajorVersion | ||
$fullVersion = "$majorVersion.$minorVersion.$microVersion" | ||
Write-Output "Found publish version, $fullVersion" | ||
echo "::set-output name=full_version::$fullVersion" | ||
|
||
- name: Add and commit changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: '${{ env.VERSION_PROPS_PATH }}' | ||
|
||
author_name: files-community-bot[bot] | ||
author_email: 152337890+files-community-bot[bot]@users.noreply.github.com | ||
default_author: github_actor | ||
|
||
message: 'Bump Files UI controls version to ${{ steps.get_version.outputs.full_version }}' | ||
new_branch: 'files/ui-controls/${{ steps.get_version.outputs.full_version }}' | ||
|
||
pathspec_error_handling: ignore | ||
push: true | ||
|
||
- name: Create Pull Request | ||
shell: pwsh | ||
env: | ||
GH_TOKEN: ${{ steps.generate.outputs.token }} | ||
run: | | ||
gh pr create --title "Controls: Bumped Controls version to ${{ steps.get_version.outputs.full_version }}" --body "This is an automated PR that bumps the version of the Files UI controls project." --base main --head bot/ui-controls/${{ steps.get_version.outputs.full_version }} |
Lamparter marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Copyright (c) Files Community | ||
# Licensed under the MIT 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 | ||
yaira2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
paths: | ||
- src/Files.App.Controls/CurrentVersion.props | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
yaira2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
environment: Deployments | ||
strategy: | ||
fail-fast: false | ||
env: | ||
SOLUTION_NAME: 'Files.slnx' | ||
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' | ||
|
||
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 | ||
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: 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 ` | ||
-p:PackageOutputPath="$env:WORKING_DIR\output" | ||
|
||
- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,15 @@ | ||||||||||||||||||||||
<!-- Copyright (c) Files Community. Licensed under the MIT License. --> | ||||||||||||||||||||||
<!-- READ ME BEFORE MODIFYING THIS FILE: | ||||||||||||||||||||||
This file is used to track the version of the Files UI Controls package online. | ||||||||||||||||||||||
The version is automatically bumped by the 'Bump Files UI Controls' action online. | ||||||||||||||||||||||
You can bump the version here in a PR and when it is merged the controls project | ||||||||||||||||||||||
will be automatically published to NuGet online. --> | ||||||||||||||||||||||
Comment on lines
+2
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this change is necessary. |
||||||||||||||||||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||||||||||||||||||||
<PropertyGroup> | ||||||||||||||||||||||
<MajorVersion>1</MajorVersion> | ||||||||||||||||||||||
<MinorVersion>0</MinorVersion> | ||||||||||||||||||||||
<!-- This version is bumped automatically by CI. --> | ||||||||||||||||||||||
<MicroVersion>0</MicroVersion> | ||||||||||||||||||||||
<Version>$(MajorVersion).$(MinorVersion).$(MicroVersion)</Version> | ||||||||||||||||||||||
</PropertyGroup> | ||||||||||||||||||||||
</Project> |
Lamparter marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yaira2 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
> 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 provided as is. | ||
If you have questions about the design or implementation of these controls, please ask [on Discord](https://discord.gg/files). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.