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
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: 'CodeQL Advanced'

on:
push:
branches: ['master']
branches: ['main']
pull_request:
branches: ['master']
branches: ['main']
schedule:
- cron: '32 13 * * 1'

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Release"
on:
pull_request:
types: [closed]
branches: [master]
branches: [main]

permissions:
contents: read
Expand All @@ -18,7 +18,7 @@ jobs:
check-release-label:
name: Check for release label
runs-on: ubuntu-latest
# Run when PR with 'release' label is merged to master, or when manually triggered
# Run when PR with 'release' label is merged to main, or when manually triggered
if: |
github.event.pull_request.merged == true
&& contains(github.event.pull_request.labels.*.name, 'release')
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: master
ref: main
fetch-depth: 0

- name: Check release conditions
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: master
ref: main
fetch-depth: 0
token: ${{ steps.releaser.outputs.token }}

Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
with:
commit_message: "chore: bump version to ${{ steps.bump-version.outputs.new_version }} [version bump]"
repo: ${{ github.repository }}
branch: master
branch: main
file_pattern: "lib/PostHog.php composer.json CHANGELOG.md"
env:
GITHUB_TOKEN: ${{ steps.releaser.outputs.token }}
Expand All @@ -153,7 +153,7 @@ jobs:
run: |
LAST_CHANGELOG_ENTRY=$(awk -v defText="see CHANGELOG.md" '/^## /{if (flag) exit; flag=1} flag && /^##$/{exit} flag; END{if (!flag) print defText}' CHANGELOG.md)
gh release create "$NEW_VERSION" \
--target master \
--target main \
--title "$NEW_VERSION" \
--notes "$LAST_CHANGELOG_ENTRY"

Expand Down
6 changes: 3 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Releasing

Releases are semi-automated via GitHub Actions. When a PR with the `release` and a version bump label is merged to `master`, the release workflow is triggered.
Releases are semi-automated via GitHub Actions. When a PR with the `release` and a version bump label is merged to `main`, the release workflow is triggered.

You'll need an approval from a PostHog engineer. If you're an employee, you can see the request in the [#approvals-client-libraries](https://app.slack.com/client/TSS5W8YQZ/C0A3UEVDDNF) channel.

Expand All @@ -9,15 +9,15 @@ You'll need an approval from a PostHog engineer. If you're an employee, you can
1. **Create your PR** with the changes you want to release
2. **Add the `release` label** to the PR
3. **Add a version bump label** that should be either `bump-patch`, `bump-minor` or `bump-major`
4. **Merge the PR** to `master`
4. **Merge the PR** to `main`

Once merged, the following happens automatically:

1. A Slack notification is sent to the client libraries channel requesting approval
2. A maintainer approves the release in the GitHub `Release` environment
3. The version is bumped in `lib/PostHog.php` and `composer.json` based on the version label (`patch`, `minor`, or `major`, extracted from the label)
4. The `CHANGELOG.md` is updated with a link to the full changelog
5. Changes are committed and pushed to `master`
5. Changes are committed and pushed to `main`
6. A git tag is created (e.g., `v1.8.0`)
7. A GitHub release is created with the changelog content
8. Slack is notified of the successful release
Expand Down
Loading