Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ on:
pull_request:

env:
CLIENT_PROJECT: ConditionalDisplayers\Client
SOLUTION: ConditionalDisplayers.sln
OUTPUT_PATH: ${{ github.workspace }}\.output
OUTPUT_PATH: .\build-out\

jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches

Expand All @@ -22,11 +23,24 @@ jobs:

with:
dotnet-version: '9.x'


- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '${{env.CLIENT_PROJECT}}/package.json'
cache: 'npm'
cache-dependency-path: '${{env.CLIENT_PROJECT}}/package-lock.json'

- name: Restore NuGet packages
run: dotnet restore ${{ env.SOLUTION }} --no-cache

- name: Install Node dependencies
run: npm ci
working-directory: ${{env.CLIENT_PROJECT}}

- name: Build Client
run: npm run build
working-directory: ${{env.CLIENT_PROJECT}}

- name: Build solution
run: dotnet publish ${{ env.SOLUTION }} --configuration Release --output ${{ env.OUTPUT_PATH }}
Expand Down
43 changes: 28 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ on:
- 'release/**'

env:
SOLUTION: ConditionalDisplayers.sln
CLIENT_PROJECT: ConditionalDisplayers\Client
PLUGIN_PROJECT: ConditionalDisplayers\ConditionalDisplayers.csproj
OUTPUT_PATH: ${{ github.workspace }}\.output

OUTPUT_PATH: .\build-out\
jobs:
publish-nuget:
runs-on: windows-latest
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache NuGet packages
Expand All @@ -30,37 +29,51 @@ jobs:
with:
dotnet-version: '9.x'

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '${{env.CLIENT_PROJECT}}/package.json'
cache: 'npm'
cache-dependency-path: '${{env.CLIENT_PROJECT}}/package-lock.json'

- name: Get Release Version
id: package_version
uses: KageKirin/get-csproj-version@v0
uses: KageKirin/get-csproj-version@v1
with:
file: ${{ env.PLUGIN_PROJECT }}
regex: ^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$

- name: Check Pre-Release State
- name: Check Version v${{ steps.package_version.outputs.version }} Pre-Release State
id: check_prerelease
run: |
if ('${{ steps.package_version.outputs.version }}' -match '^[0-9]+\.[0-9]+\.[0-9]+-.+$') {
echo "Pre-Release detected"
echo "Pre-Release detected"
echo "prerelease=true" >> $GITHUB_OUTPUT
} else {
echo "Pre-Release NOT detected"
echo "prerelease=false" >> $GITHUB_OUTPUT
}

- name: Restore NuGet packages
run: dotnet restore ${{ env.SOLUTION }} --no-cache

- name: Install Node dependencies
run: npm ci
working-directory: ${{env.CLIENT_PROJECT}}

- name: Pack NuGet Package
run: dotnet pack ${{ env.PLUGIN_PROJECT }} --configuration Release --output ${{ env.OUTPUT_PATH }}
- name: Build Client
run: npm run build
working-directory: ${{env.CLIENT_PROJECT}}

- name: Build
run: dotnet build ${{ env.PLUGIN_PROJECT }} --configuration Release

- name: Create the package
run: dotnet pack ${{ env.PLUGIN_PROJECT }} --no-build --no-restore --configuration Release -o ${{ env.OUTPUT_PATH }}

- name: Publish to NuGet
run: dotnet nuget push "${{ env.OUTPUT_PATH }}\*.nupkg" --skip-duplicate --api-key "$env:apiKey" -s https://api.nuget.org/v3/index.json
run: dotnet nuget push "${{ env.OUTPUT_PATH }}*.nupkg" --skip-duplicate --api-key "$env:apiKey" -s https://api.nuget.org/v3/index.json
env:
apiKey: ${{ secrets.NUGET_API_KEY }}

- name: Create Release Tag
- name: Create Release Tag v${{ steps.package_version.outputs.version }}
uses: avakar/tag-and-release@v1
id: release
with:
Expand All @@ -69,7 +82,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release Information
- name: Release Information for v${{ steps.package_version.outputs.version }}
run: |
echo Release Id: ${{ steps.release.outputs.id }}
echo Upload URL: "${{ steps.release.outputs.upload_url }}"
Expand Down
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,14 @@ paket-files/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
build/*.zip
umbracoClient/

# Ignore the Models Builder models out of date flag
**/ood.flag

# Ignore package files other than the manifest.
**/.DS_Store

**/App_Plugins/**
build/*.zip

**/App_Plugins
.DS_Store
2 changes: 1 addition & 1 deletion ConditionalDisplayers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{
.github\workflows\release.yml = .github\workflows\release.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UmbracoV15", "UmbracoV15\UmbracoV15.csproj", "{0C5896D4-816E-752E-B248-12C50F68EEFD}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebTest", "WebTest\WebTest.csproj", "{0C5896D4-816E-752E-B248-12C50F68EEFD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
3 changes: 0 additions & 3 deletions ConditionalDisplayers/.gitignore

This file was deleted.

Loading
Loading