-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove Umbraco 10 & 12 support
- Loading branch information
Showing
18 changed files
with
514 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 🤖 Auto Assign | ||
on: | ||
issues: | ||
types: [opened, edited, labeled, unlabeled] | ||
pull_request: | ||
types: [opened, edited, labeled, unlabeled] | ||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: wow-actions/auto-assign@v3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
reviewers: | | ||
${{ github.repository_owner }} | ||
assignees: | | ||
${{ github.repository_owner }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
name: Build | ||
on: | ||
pull_request: | ||
branches: "*" | ||
|
||
workflow_dispatch: | ||
jobs: | ||
build-package: | ||
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/build-template.yml@main | ||
uses: jcdcdev/jcdcdev.Umbraco.GitHub.Build@main | ||
with: | ||
project-name: 'jcdcdev.Umbraco.PackageTemplate' | ||
project-path: './src/jcdcdev.Umbraco.PackageTemplate.csproj' | ||
dotnet-pack: false | ||
umbraco-version: 13 | ||
build: | ||
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/build-template.yml@main | ||
uses: jcdcdev/jcdcdev.Umbraco.GitHub.Build@main | ||
with: | ||
project-name: 'UmbracoPackageTemplate' | ||
project-path: "./src/templates/UmbracoPackageTemplate/src/UmbracoPackageTemplate.sln" | ||
npm-enabled: true | ||
npm-working-dir: "./src/templates/UmbracoPackageTemplate/src/UmbracoPackageTemplate.Client" | ||
npm-run-command: 'build' | ||
npm-run-command: 'build' | ||
umbraco-version: 13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: 📤 Create PRs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry-run: | ||
description: "Dry run: Run the workflow without creating a Pull Request" | ||
required: false | ||
default: false | ||
type: boolean | ||
schedule: | ||
- cron: '0 2 * * *' | ||
jobs: | ||
get-branches: | ||
outputs: | ||
branches: ${{ steps.get-branches.outputs.branches }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get branches | ||
id: get-branches | ||
shell: pwsh | ||
run: | | ||
$branches = git branch -r --format="%(refname:short)" | ForEach-Object { $_.Trim() -replace "^origin/", "" } | ||
# filter only branches that start with dev/ | ||
$branches = $branches | Where-Object { $_ -match "^dev/" } | ||
$branchJson = ConvertTo-Json @($branches) -Compress | ||
Write-Host "branches=$branchJson" | ||
echo "branches=$branchJson" >> $env:GITHUB_OUTPUT | ||
create-pr: | ||
needs: get-branches | ||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
branch: ${{fromJson(needs.get-branches.outputs.branches)}} | ||
runs-on: ubuntu-latest | ||
env: | ||
DRY_RUN: ${{ contains(github.event.inputs.dry-run, 'true') }} | ||
steps: | ||
- name: Set Variables | ||
run: | | ||
TARGET=$(echo ${{ matrix.branch }} | sed 's/dev\///') | ||
SOURCE=${{ matrix.branch }} | ||
if [ -z "$TARGET" ]; then | ||
echo "TARGET is empty" | ||
exit 1 | ||
fi | ||
if [ -z "$SOURCE" ]; then | ||
echo "SOURCE is empty" | ||
exit 1 | ||
fi | ||
echo "SOURCE=$SOURCE" | ||
echo "TARGET=$TARGET" | ||
echo "SOURCE=$SOURCE" >> $GITHUB_ENV | ||
echo "TARGET=$TARGET" >> $GITHUB_ENV | ||
- name: Create Pull Request | ||
id: create-pull-request | ||
uses: jcdcdev/jcdcdev.GitHub.CreatePullRequest@main | ||
with: | ||
source-branch: ${{ env.SOURCE }} | ||
target-branch: ${{ env.TARGET }} | ||
dry-run: ${{ env.DRY_RUN }} | ||
github-token: ${{ secrets.JCDC_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: 🔃 Sync branches | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check-branch: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
is-valid-branch: ${{ steps.branch_check.outputs.is-valid-branch }} | ||
steps: | ||
- name: Check if branch name starts with 'v' | ||
id: branch_check | ||
run: | | ||
BRANCH_NAME=${{ github.ref }} | ||
if [[ $BRANCH_NAME =~ refs/heads/v.* ]]; then | ||
VALID=true | ||
else | ||
VALID=false | ||
fi | ||
echo "is-valid-branch=$VALID" >> $GITHUB_OUTPUT | ||
merge-branches: | ||
needs: check-branch | ||
permissions: | ||
contents: write | ||
if: needs.check-branch.outputs.is-valid-branch == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Merge into dev/v** | ||
run: | | ||
# Extract the version number from the branch name | ||
VERSION=$(echo "${GITHUB_REF}" | sed -n 's#refs/heads/v\([0-9]\+\)#\1#p') | ||
SOURCE_BRANCH="v${VERSION}" | ||
TARGET_BRANCH="dev/v${VERSION}" | ||
# Set git config | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | ||
echo "Merging $SOURCE_BRANCH into $TARGET_BRANCH" | ||
# Checkout the source branch | ||
git checkout $SOURCE_BRANCH | ||
git pull origin $SOURCE_BRANCH | ||
echo "Pulled latest for $SOURCE_BRANCH" | ||
# Merge into the target branch | ||
git checkout $TARGET_BRANCH | ||
git merge --no-ff $SOURCE_BRANCH -m "Merge v$VERSION into dev/v$VERSION" | ||
echo "Merged $SOURCE_BRANCH into $TARGET_BRANCH" | ||
# Push changes | ||
git push origin $TARGET_BRANCH | ||
echo "Pushed changes to $TARGET_BRANCH" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions
21
src/templates/UmbracoPackageTemplate/.github/workflows/build.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
name: 🏗️ Build | ||
on: | ||
pull_request: | ||
branches: "*" | ||
workflow_dispatch: | ||
jobs: | ||
metadata: | ||
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/generate-project-metadata.yml@main | ||
build: | ||
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/build-template.yml@main | ||
needs: | ||
- metadata | ||
with: | ||
project-name: ${{ needs.metadata.outputs.project-name }} | ||
project-path: ${{ needs.metadata.outputs.project-path }} | ||
npm-working-dir: ${{ needs.metadata.outputs.npm-working-dir }} | ||
npm-enabled: true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build | ||
uses: jcdcdev/jcdcdev.Umbraco.Github.Build@main | ||
with: | ||
project-name: UmbracoPackageTemplate | ||
project-path: src/UmbracoPackageTemplate/UmbracoPackageTemplate.csproj | ||
npm-working-dir: src/UmbracoPackageTemplate.Client | ||
npm-enabled: true | ||
umbraco-version: TOKEN_UMBRACO_VERSION |
Oops, something went wrong.