Skip to content

Commit

Permalink
feat: added our umbraco workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aochmann committed Feb 26, 2021
1 parent 568cba9 commit f554c61
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/release-umbraco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: (Umbraco) Our.Umbraco Package Generation

on:
workflow_run:
workflows: [ "Changelog generator" ]
types:
- completed
jobs:
our_umbraco:
name: Our.Umbraco Package Generation
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: windows-latest
env:
# Dotnet Setup
DOTNET_VERSION: 3.1.401

# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true

# Nuget Setup
NUGET_VERSION: 'latest'
NUGET_OUTPUT: output

# Solution Setup
CONFIG: 'Release'
SOLUTION: 'Source\Cogworks.Essentials.sln'
PACKAGE_NAME: 'Cogworks.Essentials'
VERSION: '1.0.0'
UMBRACO_OUTPUT: '.output/umbraco'

steps:
- name: Checkout commit
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0

- name: Get version
shell: bash
run: |
tag_check=$(git describe --exact-match `git rev-parse HEAD` | head -1)
echo "VERSION=$tag_check" >> $GITHUB_ENV
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- uses: nuget/setup-nuget@v1
with:
nuget-version: ${{ env.NUGET_VERSION }}

- name: NuGet Restore
run: nuget restore ${{ env.SOLUTION }}

- name: Install dependencies
run: dotnet restore ${{env.SOLUTION}}

- name: Build
run: |
dotnet build `
--configuration ${{ env.CONFIG }} `
${{ env.SOLUTION }}
- name: Copy package files
shell: bash
run: |
mkdir -p ./${{ env.UMBRACO_OUTPUT }}/ && find . -type d -regex ".*/${{ env.PACKAGE_NAME }}/bin/${{ env.CONFIG }}" -print0 | find $(xargs -0) -name "${{ env.PACKAGE_NAME }}*.dll" -print0 | xargs -0 -I {} cp -r {} ./${{ env.UMBRACO_OUTPUT }}/
mkdir -p ./${{ env.UMBRACO_OUTPUT }}/ && find . -type d -regex ".*/${{ env.PACKAGE_NAME }}/Web/UI" -print0 | xargs -0 -I {} cp -r {} ./${{ env.UMBRACO_OUTPUT }}/
is_empty_directory=$([ "$(ls -A ./${{ env.UMBRACO_OUTPUT }}/)" ] && echo false || echo true)
if [[ is_empty_directory == true ]]; then
echo "Empty output directory: ./${{ env.UMBRACO_OUTPUT }}/"
exit 1
fi
- name: Upload Our.Umbraco package Artifact to GitHub Action
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGE_NAME }}.${{ env.VERSION }}
path: ./${{ env.UMBRACO_OUTPUT }}/

0 comments on commit f554c61

Please sign in to comment.