Skip to content

Commit 186c6dd

Browse files
Merge pull request #28 from umbraco/release/2.0.0
Add publish script
2 parents b1e646d + 04fddd4 commit 186c6dd

File tree

6 files changed

+79
-4
lines changed

6 files changed

+79
-4
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
on: [push, pull_request]
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
workflow_call:
29

310
env:
411
PROJECT: ./src/Our.Umbraco.UiExamples/Our.Umbraco.UiExamples.csproj
@@ -12,6 +19,8 @@ jobs:
1219
steps:
1320
- name: Checkout
1421
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
1524

1625
- name: Setup UmbPack
1726
run: dotnet tool install Umbraco.Tools.Packages --global
@@ -20,12 +29,13 @@ jobs:
2029
run: dotnet restore ${{env.PROJECT}}
2130

2231
- name: Build
23-
run: dotnet build ${{env.PROJECT}} -c Release --no-restore
32+
run: dotnet build ${{env.PROJECT}} -c Release -p:ContinuousIntegrationBuild=true --no-restore
2433

2534
- name: Pack
2635
run: dotnet pack ${{env.PROJECT}} -c Release -o ${{env.OUTPUT}} --no-restore --no-build
2736

2837
- name: Upload artifacts
2938
uses: actions/upload-artifact@v2
3039
with:
40+
name: packages
3141
path: ${{env.OUTPUT}}

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
on:
2+
push:
3+
tags:
4+
- 'release-*'
5+
6+
jobs:
7+
build:
8+
name: Build
9+
uses: umbraco/UI-Examples/.github/workflows/build.yml@master
10+
11+
publish:
12+
name: Publish
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: Download artifacts
17+
uses: actions/download-artifact@v2
18+
with:
19+
name: packages
20+
21+
- name: Setup UmbPack
22+
run: dotnet tool install Umbraco.Tools.Packages --global
23+
24+
- name: Get Umbraco package file name
25+
run: |
26+
$packageFile = Get-Item *.zip | Select-Object -First 1 -ExpandProperty Name
27+
echo "packageFile=$packageFile" >> $GITHUB_ENV
28+
29+
- name: Push to Our Umbraco
30+
run: umbpack push "$env:packageFile" -k "$env:apiKey" -a *
31+
env:
32+
apiKey: ${{ secrets.OURUMBRACO_API_KEY }}
33+
34+
- name: Push to NuGet
35+
run: dotnet nuget push "*.nupkg" --source https://api.nuget.org/v3/index.json --api-key "$env:apiKey" --skip-duplicate
36+
env:
37+
apiKey: ${{ secrets.NUGET_API_KEY }}

UI Examples.sln

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6C66805F-8D60-40A9-AD57-856E38793846}"
77
ProjectSection(SolutionItems) = preProject
8+
.github\workflows\build.yml = .github\workflows\build.yml
9+
.github\workflows\publish.yml = .github\workflows\publish.yml
10+
src\version.json = src\version.json
811
.gitattributes = .gitattributes
912
.gitignore = .gitignore
10-
.github\workflows\build.yml = .github\workflows\build.yml
1113
CONTRIBUTING.md = CONTRIBUTING.md
1214
README.md = README.md
1315
EndProjectSection

src/Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<ItemGroup>
4+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
5+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.244" PrivateAssets="all" />
6+
</ItemGroup>
7+
<PropertyGroup>
8+
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
9+
</PropertyGroup>
10+
</Project>

src/Our.Umbraco.UiExamples/Our.Umbraco.UiExamples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<!-- NuGet package info -->
88
<PropertyGroup>
99
<PackageId>Our.Umbraco.UiExamples</PackageId>
10-
<Version>2.0.0</Version>
1110

1211
<PackageIconUrl></PackageIconUrl>
1312
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1413
<PackageProjectUrl>https://our.umbraco.com/packages/developer-tools/ui-examples/</PackageProjectUrl>
1514
<PackageTags>Umbraco</PackageTags>
1615

1716
<RepositoryUrl>https://github.com/umbraco/UI-Examples</RepositoryUrl>
17+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1818

1919
<Description>A collection of backoffice elements designed to help Umbraco developers extend the backoffice.</Description>
2020
<PackageReleaseNotes>

src/version.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3+
"version": "2.0.0",
4+
"release": {
5+
"branchName": "release/{version}"
6+
},
7+
"publicReleaseRefSpec": [
8+
"^refs/heads/master$",
9+
"^refs/heads/release/\\d+(\\.\\d+)?(\\.\\d+)?$"
10+
],
11+
"cloudBuild": {
12+
"buildNumber": {
13+
"enabled": true
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)