diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b9db1d..e583635 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,11 @@ -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_call: env: PROJECT: ./src/Our.Umbraco.UiExamples/Our.Umbraco.UiExamples.csproj @@ -12,6 +19,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup UmbPack run: dotnet tool install Umbraco.Tools.Packages --global @@ -20,7 +29,7 @@ jobs: run: dotnet restore ${{env.PROJECT}} - name: Build - run: dotnet build ${{env.PROJECT}} -c Release --no-restore + run: dotnet build ${{env.PROJECT}} -c Release -p:ContinuousIntegrationBuild=true --no-restore - name: Pack run: dotnet pack ${{env.PROJECT}} -c Release -o ${{env.OUTPUT}} --no-restore --no-build @@ -28,4 +37,5 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v2 with: + name: packages path: ${{env.OUTPUT}} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..9e1f5bf --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +on: + push: + tags: + - 'release-*' + +jobs: + build: + name: Build + uses: umbraco/UI-Examples/.github/workflows/build.yml@master + + publish: + name: Publish + runs-on: windows-latest + + steps: + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: packages + + - name: Setup UmbPack + run: dotnet tool install Umbraco.Tools.Packages --global + + - name: Get Umbraco package file name + run: | + $packageFile = Get-Item *.zip | Select-Object -First 1 -ExpandProperty Name + echo "packageFile=$packageFile" >> $GITHUB_ENV + + - name: Push to Our Umbraco + run: umbpack push "$env:packageFile" -k "$env:apiKey" -a * + env: + apiKey: ${{ secrets.OURUMBRACO_API_KEY }} + + - name: Push to NuGet + run: dotnet nuget push "*.nupkg" --source https://api.nuget.org/v3/index.json --api-key "$env:apiKey" --skip-duplicate + env: + apiKey: ${{ secrets.NUGET_API_KEY }} \ No newline at end of file diff --git a/UI Examples.sln b/UI Examples.sln index fde8094..8ef7afe 100644 --- a/UI Examples.sln +++ b/UI Examples.sln @@ -5,9 +5,11 @@ VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6C66805F-8D60-40A9-AD57-856E38793846}" ProjectSection(SolutionItems) = preProject + .github\workflows\build.yml = .github\workflows\build.yml + .github\workflows\publish.yml = .github\workflows\publish.yml + src\version.json = src\version.json .gitattributes = .gitattributes .gitignore = .gitignore - .github\workflows\build.yml = .github\workflows\build.yml CONTRIBUTING.md = CONTRIBUTING.md README.md = README.md EndProjectSection diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..7353f3a --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,10 @@ + + + + + + + + $(MSBuildThisFileDirectory) + + \ No newline at end of file diff --git a/src/Our.Umbraco.UiExamples/Our.Umbraco.UiExamples.csproj b/src/Our.Umbraco.UiExamples/Our.Umbraco.UiExamples.csproj index a179f18..b0c9b01 100644 --- a/src/Our.Umbraco.UiExamples/Our.Umbraco.UiExamples.csproj +++ b/src/Our.Umbraco.UiExamples/Our.Umbraco.UiExamples.csproj @@ -7,7 +7,6 @@ Our.Umbraco.UiExamples - 2.0.0 MIT @@ -15,6 +14,7 @@ Umbraco https://github.com/umbraco/UI-Examples + true A collection of backoffice elements designed to help Umbraco developers extend the backoffice. diff --git a/src/version.json b/src/version.json new file mode 100644 index 0000000..eaf946d --- /dev/null +++ b/src/version.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", + "version": "2.0.0", + "release": { + "branchName": "release/{version}" + }, + "publicReleaseRefSpec": [ + "^refs/heads/master$", + "^refs/heads/release/\\d+(\\.\\d+)?(\\.\\d+)?$" + ], + "cloudBuild": { + "buildNumber": { + "enabled": true + } + } +} \ No newline at end of file