Skip to content

Commit c92ebf9

Browse files
Update GitHub Actions
1 parent f385f44 commit c92ebf9

File tree

4 files changed

+30
-52
lines changed

4 files changed

+30
-52
lines changed

.github/workflows/build.yml

+17-21
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,50 @@ name: Build
33
on:
44
push:
55
branches:
6-
- master
76
- main
7+
- develop
8+
- support/*
9+
tags:
10+
- v*
811
pull_request:
912
branches:
10-
- master
1113
- main
14+
- develop
15+
- support/*
1216
workflow_call:
1317

1418
env:
1519
DOTNET_NOLOGO: true
1620
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
1721
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
18-
PROJECT: ./src/Our.Umbraco.UiExamples.v13/Our.Umbraco.UiExamples.v13.csproj
19-
OUTPUT: ./dist
22+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
2023

2124
jobs:
2225
build:
2326
name: Build
24-
runs-on: windows-latest
27+
runs-on: ubuntu-latest
2528

2629
steps:
2730
- name: Checkout
28-
uses: actions/checkout@v2
31+
uses: actions/checkout@v4
2932
with:
3033
fetch-depth: 0
3134

32-
- name: Cache NuGet packages
33-
uses: actions/cache@v1
35+
- uses: actions/setup-dotnet@v4
3436
with:
35-
path: ~/.nuget/packages
36-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
37-
restore-keys: |
38-
${{ runner.os }}-nuget-
37+
cache: true
38+
cache-dependency-path: **/packages.lock.json
3939

4040
- name: Restore
41-
run: dotnet restore ${{ env.PROJECT }} --locked-mode
41+
run: dotnet restore --locked-mode
4242

4343
- name: Build
44-
run: dotnet build ${{ env.PROJECT }} -c Release -p:ContinuousIntegrationBuild=true --no-restore
45-
46-
- name: Setup UmbPack
47-
run: dotnet tool install --tool-path $(Split-Path ${{ env.PROJECT }}) Umbraco.Tools.Packages
44+
run: dotnet build --configuration Release --property:ContinuousIntegrationBuild=true --no-restore
4845

4946
- name: Pack
50-
run: dotnet pack ${{ env.PROJECT }} -c Release -o ${{ env.OUTPUT }} --no-restore --no-build
47+
run: dotnet pack --configuration Release --no-restore --no-build --output ./artifacts/
5148

5249
- name: Upload artifacts
53-
uses: actions/upload-artifact@v2
50+
uses: actions/upload-artifact@v4
5451
with:
55-
name: packages
56-
path: ${{ env.OUTPUT }}
52+
path: ./artifacts/

.github/workflows/prepare-release.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ on:
77
description: 'The prerelease tag to apply on the release branch (if any). If not specified, any existing prerelease tag will be removed.'
88
required: false
99
default: ''
10-
type: choice
11-
options:
12-
- ''
13-
- 'beta'
14-
- 'rc'
10+
type: string
1511
versionIncrement:
1612
description: 'Overrides the versionIncrement setting set in version.json for determining the next version of the current branch.'
1713
required: false
@@ -31,11 +27,11 @@ env:
3127
jobs:
3228
prepare-release:
3329
name: Prepare release
34-
runs-on: windows-latest
30+
runs-on: ubuntu-latest
3531

3632
steps:
3733
- name: Checkout
38-
uses: actions/checkout@v2
34+
uses: actions/checkout@v4
3935
with:
4036
fetch-depth: 0
4137

@@ -45,14 +41,14 @@ jobs:
4541
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
4642
4743
- name: Setup Nerdbank.GitVersioning
48-
run: dotnet tool install --tool-path . nbgv
44+
run: dotnet tool install nbgv --tool-path ./artifacts/
4945

5046
- name: Prepare release
5147
run: |
5248
if ("${{ github.event.inputs.versionIncrement }}") {
53-
./nbgv prepare-release ${{ github.event.inputs.tag }} -p src --versionIncrement ${{ github.event.inputs.versionIncrement }}
49+
./artifacts/nbgv prepare-release ${{ github.event.inputs.tag }} --versionIncrement ${{ github.event.inputs.versionIncrement }}
5450
} else {
55-
./nbgv prepare-release ${{ github.event.inputs.tag }} -p src
51+
./artifacts/nbgv prepare-release ${{ github.event.inputs.tag }}
5652
}
5753
5854
- name: Push commit (and new branch)

.github/workflows/publish-release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ env:
1111
jobs:
1212
publish-release:
1313
name: Publish release
14-
runs-on: windows-latest
14+
runs-on: ubuntu-latest
1515

1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
2121

@@ -25,10 +25,10 @@ jobs:
2525
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
2626
2727
- name: Setup Nerdbank.GitVersioning
28-
run: dotnet tool install --tool-path . nbgv
28+
run: dotnet tool install nbgv --tool-path ./artifacts/
2929

3030
- name: Tag release
31-
run: ./nbgv tag -p src
31+
run: ./artifacts/nbgv tag
3232

3333
- name: Push git tags
3434
run: git push --tags

.github/workflows/publish.yml

+3-17
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,16 @@ env:
1212
jobs:
1313
build:
1414
name: Build
15-
uses: umbraco/UI-Examples/.github/workflows/build.yml@master
15+
uses: umbraco/UI-Examples/.github/workflows/build.yml@${GITHUB_REF}
1616

1717
publish:
1818
name: Publish
1919
needs: build
20-
runs-on: windows-latest
20+
runs-on: ubuntu-latest
2121

2222
steps:
2323
- name: Download artifacts
24-
uses: actions/download-artifact@v2
25-
with:
26-
name: packages
27-
28-
- name: Get Umbraco package file name
29-
id: get_package
30-
run: echo "::set-output name=PACKAGE::$(Get-Item *.zip | Select-Object -First 1 -ExpandProperty Name)"
31-
32-
- name: Setup UmbPack
33-
if: steps.get_package.outputs.PACKAGE
34-
run: dotnet tool install --tool-path . Umbraco.Tools.Packages
35-
36-
- name: Push to Our.Umbraco
37-
if: steps.get_package.outputs.PACKAGE
38-
run: ./umbpack push ${{ steps.get_package.outputs.PACKAGE }} -k ${{ secrets.OURUMBRACO_API_KEY }} -a *
24+
uses: actions/download-artifact@v4
3925

4026
- name: Push to NuGet
4127
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate

0 commit comments

Comments
 (0)