Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

ci(release): support main during production branch rename

Andras Bacsai12b14bbefdd7
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index e1286eb221..c226b15389 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -46,6 +46,6 @@
> [!IMPORTANT]
>
-> - [ ] I have read and understood the [contributor guidelines](https://github.com/coollabsio/coolify/blob/v4.x/CONTRIBUTING.md). If I have failed to follow any guideline, I understand that this PR may be closed without review.
+> - [ ] I have read and understood the [contributor guidelines](https://github.com/coollabsio/coolify/blob/HEAD/CONTRIBUTING.md). If I have failed to follow any guideline, I understand that this PR may be closed without review.
> - [ ] I have searched [existing issues](https://github.com/coollabsio/coolify/issues) and [pull requests](https://github.com/coollabsio/coolify/pulls) (including closed ones) to ensure this isn't a duplicate.
> - [ ] I have tested all the changes thoroughly with a local development instance of Coolify and I am confident that they will work as expected when a maintainer tests them.
diff --git a/.github/workflows/coolify-release.yml b/.github/workflows/coolify-release.yml
index 7951005eea..315802bb3a 100644
--- a/.github/workflows/coolify-release.yml
+++ b/.github/workflows/coolify-release.yml
@@ -29,10 +29,10 @@ jobs:
release_id: ${{ steps.draft.outputs.release_id }}
version: ${{ steps.version.outputs.version }}
steps:
- - name: Reject releases outside v4.x
- if: ${{ github.ref_name != 'v4.x' }}
+ - name: Reject releases outside the production branch
+ if: ${{ ! contains(fromJSON('["v4.x", "main"]'), github.ref_name) }}
run: |
- echo "Fix releases must run from v4.x, not ${{ github.ref_name }}."
+ echo "Stable releases must run from v4.x or main, not ${{ github.ref_name }}."
exit 1
- uses: actions/checkout@v5
diff --git a/.github/workflows/coolify-sha-build.yml b/.github/workflows/coolify-sha-build.yml
index 522dc21f5c..5b4e43002c 100644
--- a/.github/workflows/coolify-sha-build.yml
+++ b/.github/workflows/coolify-sha-build.yml
@@ -2,7 +2,7 @@ name: Build Coolify (SHA)
on:
push:
- branches: ["v4.x"]
+ branches: ["v4.x", "main"]
permissions:
contents: read
diff --git a/.github/workflows/coolify-staging-build.yml b/.github/workflows/coolify-staging-build.yml
index c5b70ca92c..df0508c98d 100644
--- a/.github/workflows/coolify-staging-build.yml
+++ b/.github/workflows/coolify-staging-build.yml
@@ -4,6 +4,7 @@ on:
push:
branches-ignore:
- v4.x
+ - main
- v3.x
- '**v5.x**'
paths-ignore:
diff --git a/.github/workflows/generate-changelog.yml b/.github/workflows/generate-changelog.yml
index a5fb7c69df..1a16ec1e2a 100644
--- a/.github/workflows/generate-changelog.yml
+++ b/.github/workflows/generate-changelog.yml
@@ -2,7 +2,7 @@ name: Generate Changelog
on:
push:
- branches: [ v4.x ]
+ branches: [ v4.x, main ]
paths-ignore:
- .github/workflows/coolify-helper.yml
- .github/workflows/coolify-helper-next.yml
diff --git a/AGENTS.md b/AGENTS.md
index e81c62a3c6..ebd2e71387 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -146,9 +146,9 @@ function loginAsRoot(): mixed
## Git Workflow
-- Main branch: `v4.x`
+- Production branch: `main` (`v4.x` during the branch rename)
- Development branch: `next`
-- PRs should target `v4.x`
+- Fix PRs should target the current production branch; feature PRs should target `next`
<laravel-boost-guidelines>
=== foundation rules ===
diff --git a/tests/Unit/ProductionImageWorkflowTest.php b/tests/Unit/ProductionImageWorkflowTest.php
index 428ec27a6e..ec6f735c75 100644
--- a/tests/Unit/ProductionImageWorkflowTest.php
+++ b/tests/Unit/ProductionImageWorkflowTest.php
@@ -7,8 +7,7 @@ it('publishes v4 branch builds under the commit sha with a traceable internal ve
expect($workflow)
->toContain('name: Build Coolify (SHA)')
- ->toContain('branches: ["v4.x"]')
- ->not->toContain('branches: ["v4.x", "main"]')
+ ->toContain('branches: ["v4.x", "main"]')
->toContain('sha-${{ github.sha }}-${{ matrix.arch }}')
->toContain('sha-${{ github.sha }}')
->toContain('php bootstrap/getVersion.php')
@@ -34,7 +33,7 @@ it('requires a reviewed draft release before building a stable version', functio
->toContain('name: Release Coolify Stable')
->toContain('workflow_dispatch:')
->toContain('tag:')
- ->toContain('github.ref_name != \'v4.x\'')
+ ->toContain('contains(fromJSON(\'["v4.x", "main"]\'), github.ref_name)')
->toContain('github.paginate(github.rest.repos.listReleases')
->toContain('release.draft')
->toContain('release.prerelease')
@@ -56,20 +55,18 @@ it('keeps support image workflows ready for the production branch rename', funct
'realtime' => 'coolify-realtime.yml',
]);
-it('generates the production changelog only from v4.x', function () {
+it('generates the production changelog from either production branch during the rename', function () {
$workflow = file_get_contents(dirname(__DIR__, 2).'/.github/workflows/generate-changelog.yml');
- expect($workflow)
- ->toContain('branches: [ v4.x ]')
- ->not->toContain('main');
+ expect($workflow)->toContain('branches: [ v4.x, main ]');
});
-it('excludes only active production branches from staging builds', function () {
+it('excludes both production branch names from staging builds during the rename', function () {
$workflow = file_get_contents(dirname(__DIR__, 2).'/.github/workflows/coolify-staging-build.yml');
expect($workflow)
->toContain(' - v4.x')
- ->not->toContain(' - main');
+ ->toContain(' - main');
});
it('rebuilds stable images and publishes the reviewed draft after both architectures succeed', function () {