Skip to content

Commit 487f777

Browse files
committed
feature: initial commit
0 parents  commit 487f777

File tree

181 files changed

+15712
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+15712
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Contributing Guidelines
2+
3+
Contributions to this package are most welcome!
4+
5+
There is a test site in the solution to make working with this repository easier.

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Bug report"
2+
description: "File a bug report to help improve this package."
3+
labels: "bug"
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to report this issue as thoroughly as possible.
9+
- type: input
10+
id: "PackageVersion"
11+
attributes:
12+
label: "Which jcdcdev.Umbraco.RelationsManager version are you using?"
13+
description: "Leave blank if you're not sure: the latest version will be assumed."
14+
validations:
15+
required: false
16+
- type: input
17+
id: "umbracoVersion"
18+
attributes:
19+
label: "Which Umbraco version are you using? For example: 10.4.0 - don't just write v10"
20+
description: "Use the help icon in the Umbraco backoffice to find the version you're using."
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: "summary"
25+
attributes:
26+
label: "Bug summary"
27+
description: "Write a summary of the bug. Remember that you can format code and logs nicely with the `<>` button"
28+
placeholder: >
29+
Try to pinpoint it as much as possible.
30+
31+
Try to state the actual problem, and not just what you think the solution might be.
32+
validations:
33+
required: true
34+
- type: textarea
35+
attributes:
36+
label: "Steps to reproduce"
37+
id: "reproduction"
38+
description: "How can we reproduce the problem on a clean AdminOnlyPackage + Umbraco install?"
39+
placeholder: >
40+
Please include any links, screenshots, stack-traces, etc.
41+
validations:
42+
required: true
43+
- type: textarea
44+
attributes:
45+
label: "Expected result / actual result"
46+
id: "result"
47+
description: "What did you expect that would happen on your Umbraco site and what is the actual result of the above steps?"
48+
placeholder: >
49+
Describe the intended/desired outcome after you did the steps mentioned.
50+
51+
Describe the behaviour of the bug

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Feature request"
2+
description: "Suggest an idea for this package."
3+
labels: "enhancement"
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to suggest this feature request!
9+
- type: textarea
10+
id: "summary"
11+
attributes:
12+
label: "Feature summary"
13+
description: "Write a brief summary of the feature"
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: "details"
18+
attributes:
19+
label: "Additional details"
20+
description: "Provide any additional details or comments about the feature you are suggesting"
21+
validations:
22+
required: false

.github/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Umbraco.Community.SimpleTrees
2+
3+

.github/workflows/auto-assign.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 🤖 Auto Assign
2+
on:
3+
issues:
4+
types: [opened, edited, labeled, unlabeled]
5+
pull_request:
6+
types: [opened, edited, labeled, unlabeled]
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: wow-actions/auto-assign@v3
12+
with:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
reviewers: |
15+
${{ github.repository_owner }}
16+
assignees: |
17+
${{ github.repository_owner }}

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 🏗️ Build
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Build
10+
uses: jcdcdev/jcdcdev.Umbraco.Github.Build@main
11+
with:
12+
project-name: Umbraco.Community.SimpleTrees
13+
project-path: src/Umbraco.Community.SimpleTrees/Umbraco.Community.SimpleTrees.csproj
14+
npm-working-dir: src/Umbraco.Community.SimpleTrees.Client
15+
npm-enabled: true
16+
umbraco-version: 16
17+
dotnet-version: "9"
18+
npm-version: "22.x"

.github/workflows/create-pr.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: 📤 Create PRs
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
dry-run:
6+
description: "Dry run: Run the workflow without creating a Pull Request"
7+
required: false
8+
default: false
9+
type: boolean
10+
schedule:
11+
- cron: '0 2 * * *'
12+
jobs:
13+
get-branches:
14+
outputs:
15+
branches: ${{ steps.get-branches.outputs.branches }}
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Get branches
23+
id: get-branches
24+
shell: pwsh
25+
run: |
26+
$branches = git branch -r --format="%(refname:short)" | ForEach-Object { $_.Trim() -replace "^origin/", "" }
27+
# filter only branches that start with dev/
28+
$branches = $branches | Where-Object { $_ -match "^dev/" }
29+
$branchJson = ConvertTo-Json @($branches) -Compress
30+
Write-Host "branches=$branchJson"
31+
echo "branches=$branchJson" >> $env:GITHUB_OUTPUT
32+
create-pr:
33+
needs: get-branches
34+
strategy:
35+
max-parallel: 1
36+
matrix:
37+
branch: ${{fromJson(needs.get-branches.outputs.branches)}}
38+
runs-on: ubuntu-latest
39+
env:
40+
DRY_RUN: ${{ contains(github.event.inputs.dry-run, 'true') }}
41+
steps:
42+
- name: Set Variables
43+
run: |
44+
TARGET=$(echo ${{ matrix.branch }} | sed 's/dev\///')
45+
SOURCE=${{ matrix.branch }}
46+
47+
if [ -z "$TARGET" ]; then
48+
echo "TARGET is empty"
49+
exit 1
50+
fi
51+
52+
if [ -z "$SOURCE" ]; then
53+
echo "SOURCE is empty"
54+
exit 1
55+
fi
56+
57+
echo "SOURCE=$SOURCE"
58+
echo "TARGET=$TARGET"
59+
60+
echo "SOURCE=$SOURCE" >> $GITHUB_ENV
61+
echo "TARGET=$TARGET" >> $GITHUB_ENV
62+
- name: Create Pull Request
63+
id: create-pull-request
64+
uses: jcdcdev/jcdcdev.GitHub.CreatePullRequest@main
65+
with:
66+
source-branch: ${{ env.SOURCE }}
67+
target-branch: ${{ env.TARGET }}
68+
dry-run: ${{ env.DRY_RUN }}
69+
github-token: ${{ secrets.JCDC_BOT_TOKEN }}

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 🚀 Release
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
types: [ closed ]
6+
jobs:
7+
release:
8+
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
steps:
14+
- name: Build
15+
id: build
16+
uses: jcdcdev/jcdcdev.Umbraco.GitHub.Build@main
17+
with:
18+
project-name: Umbraco.Community.SimpleTrees
19+
project-path: src/Umbraco.Community.SimpleTrees/Umbraco.Community.SimpleTrees.csproj
20+
npm-working-dir: src/Umbraco.Community.SimpleTrees.Client
21+
npm-enabled: true
22+
npm-version: "22.x"
23+
umbraco-version: 16
24+
dotnet-version: "9"
25+
- name: Release
26+
uses: jcdcdev/jcdcdev.Umbraco.GitHub.Release@main
27+
with:
28+
artifact-name: ${{ steps.build.outputs.artifact-name }}
29+
version: ${{ steps.build.outputs.version }}
30+
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
31+
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: 🔃 Sync branches
2+
3+
on:
4+
push:
5+
branches:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
check-branch:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
is-valid-branch: ${{ steps.branch_check.outputs.is-valid-branch }}
14+
steps:
15+
- name: Check if branch name starts with 'v'
16+
id: branch_check
17+
run: |
18+
BRANCH_NAME=${{ github.ref }}
19+
if [[ $BRANCH_NAME =~ refs/heads/v.* ]]; then
20+
VALID=true
21+
else
22+
VALID=false
23+
fi
24+
25+
echo "is-valid-branch=$VALID" >> $GITHUB_OUTPUT
26+
merge-branches:
27+
needs: check-branch
28+
permissions:
29+
contents: write
30+
if: needs.check-branch.outputs.is-valid-branch == 'true'
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
- name: Merge into dev/v**
38+
run: |
39+
# Extract the version number from the branch name
40+
VERSION=$(echo "${GITHUB_REF}" | sed -n 's#refs/heads/v\([0-9]\+\)#\1#p')
41+
SOURCE_BRANCH="v${VERSION}"
42+
TARGET_BRANCH="dev/v${VERSION}"
43+
# Set git config
44+
git config user.name "${{ github.actor }}"
45+
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
46+
47+
48+
echo "Merging $SOURCE_BRANCH into $TARGET_BRANCH"
49+
50+
# Checkout the source branch
51+
git checkout $SOURCE_BRANCH
52+
git pull origin $SOURCE_BRANCH
53+
echo "Pulled latest for $SOURCE_BRANCH"
54+
55+
# Merge into the target branch
56+
git checkout $TARGET_BRANCH
57+
git merge --no-ff $SOURCE_BRANCH -m "Merge v$VERSION into dev/v$VERSION"
58+
echo "Merged $SOURCE_BRANCH into $TARGET_BRANCH"
59+
60+
# Push changes
61+
git push origin $TARGET_BRANCH
62+
echo "Pushed changes to $TARGET_BRANCH"
63+

0 commit comments

Comments
 (0)