Skip to content

Commit a8a757e

Browse files
committed
Add versioning file
1 parent 744ab9d commit a8a757e

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

.github/workflows/cd-controls.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ jobs:
3232
WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\
3333
PROJECT_DIR: '${{ github.workspace }}\src\Files.App.Controls'
3434
PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\Files.App.Controls\Files.App.Controls.csproj'
35-
PACKAGE_MANIFEST_PATH: '${{ github.workspace }}\src\Files.App (Package)\Package.appxmanifest'
3635

3736
steps:
3837
- name: Checkout the repository
@@ -51,13 +50,13 @@ jobs:
5150
run: |
5251
for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt
5352
54-
- name: Extract Version from Package.appxmanifest
53+
- name: Extract Version from CurrentVersion.props
5554
id: extract_version
5655
shell: pwsh
5756
run: |
58-
$xml = [xml](Get-Content $env:PACKAGE_MANIFEST_PATH)
59-
$version = $xml.Package.Identity.Version
60-
Write-Output "Found package version, $version"
57+
$xml = [xml](Get-Content $env:PROJECT_DIR\CurrentVersion.props)
58+
$version = $xml.Project.PropertyGroup.Version
59+
Write-Output "Found publish version, $version"
6160
echo "::set-output name=version::$version"
6261
6362
- name: Restore NuGet
@@ -76,7 +75,7 @@ jobs:
7675
-p:Configuration=$env:CONFIGURATION
7776
7877
- name: Package Files UI Controls
79-
run: dotnet pack ${{ env.PACKAGE_PROJECT_PATH }} --configuration Release --no-build -o ./output -p:Version=${{ steps.extract_version.outputs.version }}
78+
run: dotnet pack ${{ env.PACKAGE_PROJECT_PATH }} --configuration ${{ env.CONFIGURATION }} --no-build -o ./output -p:Version=${{ steps.extract_version.outputs.version }}
8079

8180
- name: Publish package to NuGet
8281
run: dotnet nuget push ./output/*.nupkg --api-key (SECRET GOES HERE) --source https://api.nuget.org/v3/index.json
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
2+
<!-- This is an auto-generated file that is used to track the version of the Files UI Controls package online.
3+
The version is automatically bumped by the 'Files CD (Bump UI controls version)' action online.
4+
You can bump the version here in a PR and when it is merged the controls project will be automatically
5+
published to NuGet online. -->
6+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
7+
<PropertyGroup>
8+
<MajorVersion>1</MajorVersion>
9+
<MinorVersion>0</MinorVersion>
10+
<!-- This version is bumped automatically by CI. -->
11+
<MicroVersion>0</MicroVersion>
12+
13+
<Version>$(MajorVersion).$(MinorVersion).$(MicroVersion)</Version>
14+
</PropertyGroup>
15+
</Project>

0 commit comments

Comments
 (0)