Skip to content

Commit

Permalink
Merge branch 'main' into chore/migration-flags
Browse files Browse the repository at this point in the history
  • Loading branch information
JessChowdhury committed Nov 19, 2024
2 parents b453024 + 037662d commit d23ede3
Show file tree
Hide file tree
Showing 851 changed files with 47,918 additions and 78,889 deletions.
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ updates:
- /.github/workflows
- /.github/actions/* # Not working until resolved: https://github.com/dependabot/dependabot-core/issues/6345
- /.github/actions/setup
target-branch: beta
target-branch: main
schedule:
interval: monthly
timezone: America/Detroit
Expand All @@ -20,7 +20,7 @@ updates:

- package-ecosystem: npm
directory: /
target-branch: beta
target-branch: main
schedule:
interval: weekly
day: sunday
Expand Down Expand Up @@ -53,7 +53,7 @@ updates:
# Only bump patch versions for 2.x
- package-ecosystem: npm
directory: /
target-branch: main
target-branch: 2.x
schedule:
interval: weekly
day: sunday
Expand Down
4 changes: 2 additions & 2 deletions .github/reproduction-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ There are a couple ways run integration tests:

- **Granularly** - you can run individual tests in vscode by installing the Jest Runner plugin and using that to run individual tests. Clicking the `debug` button will run the test in debug mode allowing you to set break points.

<img src="https://raw.githubusercontent.com/payloadcms/payload/main/packages/payload/src/admin/assets/images/github/int-debug.png" />
<img src="https://raw.githubusercontent.com/payloadcms/payload/main/packages/payload/src/assets/images/github/int-debug.png" />

- **Manually** - you can run all int tests in the `/test/_community/int.spec.ts` file by running the following command:

Expand All @@ -57,7 +57,7 @@ The easiest way to run E2E tests is to install

Once they are installed you can open the `testing` tab in vscode sidebar and drill down to the test you want to run, i.e. `/test/_community/e2e.spec.ts`

<img src="https://raw.githubusercontent.com/payloadcms/payload/main/packages/payload/src/admin/assets/images/github/e2e-debug.png" />
<img src="https://raw.githubusercontent.com/payloadcms/payload/main/packages/payload/src/assets/images/github/e2e-debug.png" />

#### Notes

Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
push:
branches:
- main
- beta

concurrency:
# <workflow_name>-<branch_name>-<true || commit_sha if branch is protected>
Expand Down Expand Up @@ -284,7 +283,7 @@ jobs:
tests-e2e:
runs-on: ubuntu-latest
needs: build
name: ${{ matrix.suite }}
name: e2e-${{ matrix.suite }}
strategy:
fail-fast: false
matrix:
Expand All @@ -294,6 +293,7 @@ jobs:
- access-control
- admin__e2e__1
- admin__e2e__2
- admin__e2e__3
- admin-root
- auth
- field-error-states
Expand Down Expand Up @@ -414,6 +414,10 @@ jobs:
- template: with-vercel-postgres
database: postgres

# Re-enable once PG conncection is figured out
# - template: with-vercel-website
# database: postgres

name: ${{ matrix.template }}-${{ matrix.database }}

env:
Expand Down Expand Up @@ -525,12 +529,12 @@ jobs:
publish-canary:
name: Publish Canary
runs-on: ubuntu-latest
if: ${{ needs.all-green.result == 'success' && github.ref_name == 'beta' }}
if: ${{ needs.all-green.result == 'success' && github.ref_name == 'main' }}
needs:
- all-green

steps:
# debug github.ref output
- run: |
echo github.ref: ${{ github.ref }}
echo isBeta: ${{ github.ref == 'refs/heads/beta' }}
echo isV3: ${{ github.ref == 'refs/heads/main' }}
81 changes: 79 additions & 2 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,26 @@ on:
types:
- published
workflow_dispatch:
inputs:
tag:
description: 'Release tag to process (optional)'
required: false
default: ''

env:
NODE_VERSION: 22.6.0
PNPM_VERSION: 9.7.1
DO_NOT_TRACK: 1 # Disable Turbopack telemetry
NEXT_TELEMETRY_DISABLED: 1 # Disable Next telemetry

jobs:
post_release:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Only needed if debugging on a branch other than default
# ref: ${{ github.event.release.target_commitish || github.ref }}
- uses: ./.github/actions/release-commenter
continue-on-error: true
env:
Expand All @@ -28,3 +38,70 @@ jobs:

comment-template: |
🚀 This is included in version {release_link}
update_templates:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
with:
node-version: ${{ env.NODE_VERSION }}
pnpm-version: ${{ env.PNPM_VERSION }}

- name: Update template lockfiles and migrations
run: pnpm script:gen-templates

- name: Determine Release Tag
id: determine_tag
run: |
if [ "${{ github.event.inputs.tag }}" != "" ]; then
echo "Using tag from input: ${{ github.event.inputs.tag }}"
echo "release_tag=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "Using tag from release event: ${{ github.event.release.tag_name }}"
echo "release_tag=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push changes
id: commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ex
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
export BRANCH_NAME=chore/templates-${{ steps.determine_tag.outputs.release_tag }}
git checkout -b $BRANCH_NAME
git add -A
# If no files have changed, exit early with success
git diff --cached --quiet --exit-code && exit 0
git commit -m "chore(templates): bump lockfiles after ${{ steps.determine_tag.outputs.release_tag }}"
git push origin $BRANCH_NAME
echo "committed=true" >> "$GITHUB_OUTPUT"
echo "branch=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
- name: Debug Branches
run: |
echo "Target Commitish: ${{ github.event.release.target_commitish }}"
echo "Branch: ${{ steps.commit.outputs.branch }}"
echo "Ref: ${{ github.ref }}"
- name: Create pull request
uses: peter-evans/create-pull-request@v7
if: steps.commit.outputs.committed == 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: 'area: templates'
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
commit-message: 'Automated update after release'
branch: ${{ steps.commit.outputs.branch }}
base: ${{ github.event_name != 'workflow_dispatch' && github.event.release.target_commitish || github.ref }}
title: 'chore(templates): bump lockfiles after ${{ steps.determine_tag.outputs.release_tag }}'
body: 'Automated bump of template lockfiles after release ${{ steps.determine_tag.outputs.release_tag }}'
8 changes: 4 additions & 4 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ jobs:
runs-on: ubuntu-latest
if: github.event.action == 'opened'
steps:
- name: Tag with main branch with v2
if: github.event.pull_request.base.ref == 'main'
- name: Tag with 2.x branch with v2
if: github.event.pull_request.base.ref == '2.x'
uses: actions-ecosystem/action-add-labels@v1
with:
labels: v2
- name: Tag with beta branch with v3
if: github.event.pull_request.base.ref == 'beta'
- name: Tag with main branch with v3
if: github.event.pull_request.base.ref == 'main'
uses: actions-ecosystem/action-add-labels@v1
with:
labels: v3
2 changes: 1 addition & 1 deletion .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: release-canary
on:
workflow_dispatch:
branches:
- beta
- main

env:
NODE_VERSION: 22.6.0
Expand Down
Loading

0 comments on commit d23ede3

Please sign in to comment.