Skip to content

Merge pull request #57 from hfloyd/feature/fix-Level-value #26

Merge pull request #57 from hfloyd/feature/fix-Level-value

Merge pull request #57 from hfloyd/feature/fix-Level-value #26

Workflow file for this run

# 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 }}/**/*