-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (58 loc) · 2.49 KB
/
build.yml
File metadata and controls
75 lines (58 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Builds a library, and packages it up.
#
# Works on a release/version tag
# e.g release/1.0.2 will build v1.0.2
#
name: Build and Package
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
NAME: Our.Umbraco.SimpleTreeMenu
UMBNAME: SimpleTreeMenu
OUTPUT: ./Output
LIBRARY_FOLDER: ./src/TreeMenu
CONFIG: release
on:
push:
tags:
- "release/*"
jobs:
build:
runs-on: windows-latest
steps:
- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/release\//}
shell: bash
- name: Compare version with 5.0.0
id: compare_versions
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
if [[ "$(printf '%s\n' "$VERSION" "5.0.0" | sort -V | head -n1)" == "$VERSION" && "$VERSION" != "5.0.0" ]]; then
echo "::set-output name=is_lower_than_v5::true"
else
echo "::set-output name=is_lower_than_v5::false"
fi
shell: bash
- name: checkout
uses: actions/checkout@v2
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1
- name: Setup .net core
uses: actions/setup-dotnet@v1
- name: Setup UmbPack
run: dotnet tool install Umbraco.Tools.Packages --global
- name: Create NuGet package file
run: dotnet pack ${{ env.LIBRARY_FOLDER }} -c ${{ env.CONFIG }} -o ${{ env.OUTPUT }} /p:version=${{ steps.get_version.outputs.VERSION }}
- name: Push NuGet package file
run: dotnet nuget push ${{ env.OUTPUT }}/${{ env.NAME }}.${{ steps.get_version.outputs.VERSION }}.nupkg --skip-duplicate -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
# - name: Create Umbraco package file
# if: steps.compare_versions.outputs.is_lower_than_v5 == 'true'
# run: UmbPack pack ./package.xml -n ${{ env.UMBNAME }}_${{ steps.get_version.outputs.VERSION }}.zip -o ${{ env.OUTPUT }} -v ${{ steps.get_version.outputs.VERSION }}
# - name: Push Umbraco package file
# if: steps.compare_versions.outputs.is_lower_than_v5 == 'true'
# run: UmbPack push "${{ env.OUTPUT }}/${{ env.UMBNAME }}_${{ steps.get_version.outputs.VERSION }}.zip" -k ${{ secrets.UMB_API_KEY }}
- name: upload-artifacts
uses: actions/upload-artifact@v2
with:
name: Build-Results-${{ steps.get_version.outputs.VERSION }}
path: ${{ env.OUTPUT }}/**/*