Skip to content

Commit 71c15e8

Browse files
Add NuGet lockfile, caching and fix public release refspec
1 parent c635d87 commit 71c15e8

File tree

5 files changed

+2396
-9
lines changed

5 files changed

+2396
-9
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,27 @@ jobs:
2525
with:
2626
fetch-depth: 0
2727

28+
- uses: actions/cache@v1
29+
with:
30+
path: ~/.nuget/packages
31+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-nuget-
34+
2835
- name: Setup UmbPack
2936
run: dotnet tool install Umbraco.Tools.Packages --global
3037

3138
- name: Restore
32-
run: dotnet restore ${{env.PROJECT}}
39+
run: dotnet restore ${{ env.PROJECT }} --locked-mode
3340

3441
- name: Build
35-
run: dotnet build ${{env.PROJECT}} -c Release -p:ContinuousIntegrationBuild=true --no-restore
42+
run: dotnet build ${{ env.PROJECT }} -c Release -p:ContinuousIntegrationBuild=true --no-restore
3643

3744
- name: Pack
38-
run: dotnet pack ${{env.PROJECT}} -c Release -o ${{env.OUTPUT}} --no-restore --no-build
45+
run: dotnet pack ${{ env.PROJECT }} -c Release -o ${{ env.OUTPUT }} --no-restore --no-build
3946

4047
- name: Upload artifacts
4148
uses: actions/upload-artifact@v2
4249
with:
4350
name: packages
44-
path: ${{env.OUTPUT}}
51+
path: ${{ env.OUTPUT }}

.github/workflows/publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ env:
1010

1111
jobs:
1212
build:
13-
name: Build
1413
uses: umbraco/UI-Examples/.github/workflows/build.yml@master
1514

1615
publish:
@@ -33,11 +32,11 @@ jobs:
3332
echo "OURUMBRACO_PACKAGE=$packageFile" >> $GITHUB_ENV
3433
3534
- name: Push to Our.Umbraco
36-
run: umbpack push "${{env.OURUMBRACO_PACKAGE}}" -k "$env:apiKey" -a *
35+
run: umbpack push "${{ env.OURUMBRACO_PACKAGE }}" -k "$env:apiKey" -a *
3736
env:
38-
apiKey: ${{secrets.OURUMBRACO_API_KEY}}
37+
apiKey: ${{ secrets.OURUMBRACO_API_KEY }}
3938

4039
- name: Push to NuGet
4140
run: dotnet nuget push "*.nupkg" --api-key "$env:apiKey" --skip-duplicate
4241
env:
43-
apiKey: ${{secrets.NUGET_API_KEY}}
42+
apiKey: ${{ secrets.NUGET_API_KEY }}

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.244" PrivateAssets="all" />
66
</ItemGroup>
77
<PropertyGroup>
8+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
89
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
910
</PropertyGroup>
1011
</Project>

0 commit comments

Comments
 (0)