Skip to content

Commit fca9808

Browse files
authored
chore: extract releasing docs & update github actions (#113)
1 parent a242e2a commit fca9808

5 files changed

Lines changed: 36 additions & 33 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions/checkout@v6
3030

3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
32+
uses: github/codeql-action/init@0e9f55954318745b37b7933c693bc093f7336125 # v4.35.1
3333
with:
3434
languages: ${{ matrix.language }}
3535
build-mode: ${{ matrix.build-mode }}
@@ -39,6 +39,6 @@ jobs:
3939
trap-caching: false
4040

4141
- name: Perform CodeQL Analysis
42-
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
42+
uses: github/codeql-action/analyze@0e9f55954318745b37b7933c693bc093f7336125 # v4.35.1
4343
with:
4444
category: '/language:${{matrix.language}}'

.github/workflows/php.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
php-version: [8.2, 8.3, 8.4, 8.5]
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v6
2020

2121
- name: Set up PHP ${{ matrix.php-version }}
2222
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
@@ -34,7 +34,7 @@ jobs:
3434
phpcs:
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v6
3838
with:
3939
fetch-depth: 0 # important!
4040

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
bump-type: ${{ steps.check.outputs.bump-type }}
2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v6
3131
with:
3232
ref: master
3333
fetch-depth: 0
@@ -85,13 +85,13 @@ jobs:
8585

8686
- name: Get GitHub App token
8787
id: releaser
88-
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
88+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
8989
with:
9090
app-id: ${{ secrets.GH_APP_POSTHOG_PHP_RELEASER_APP_ID }}
9191
private-key: ${{ secrets.GH_APP_POSTHOG_PHP_RELEASER_PRIVATE_KEY }} # Secrets available only inside the 'Release' environment, requires approval from a maintainer
9292

9393
- name: Checkout repository
94-
uses: actions/checkout@v4
94+
uses: actions/checkout@v6
9595
with:
9696
ref: master
9797
fetch-depth: 0
@@ -174,7 +174,7 @@ jobs:
174174
175175
- name: Notify Slack - Failed
176176
if: ${{ failure() && needs.notify-approval-needed.outputs.slack_ts != '' }}
177-
uses: posthog/.github/.github/actions/slack-thread-reply@9b04bf3288aca2b4cd3883070858b034b4f7f334
177+
uses: posthog/.github/.github/actions/slack-thread-reply@main
178178
with:
179179
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
180180
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
@@ -189,10 +189,10 @@ jobs:
189189
if: always() && needs.release.result == 'success' && needs.notify-approval-needed.outputs.slack_ts != ''
190190
steps:
191191
- name: Checkout repository
192-
uses: actions/checkout@v4
192+
uses: actions/checkout@v6
193193

194194
- name: Notify Slack - Released
195-
uses: posthog/.github/.github/actions/slack-thread-reply@9b04bf3288aca2b4cd3883070858b034b4f7f334
195+
uses: posthog/.github/.github/actions/slack-thread-reply@main
196196
with:
197197
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
198198
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}

README.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,4 @@ Specifically, the [PHP integration](https://posthog.com/docs/integrations/php-in
3333

3434
## Releasing
3535

36-
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.
37-
38-
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.
39-
40-
### Release Process
41-
42-
1. **Create your PR** with the changes you want to release
43-
2. **Add the `release` label** to the PR
44-
3. **Add a version bump label** that should be either `bump-patch`, `bump-minor` or `bump-major`
45-
4. **Merge the PR** to `master`
46-
47-
Once merged, the following happens automatically:
48-
49-
1. A Slack notification is sent to the client libraries channel requesting approval
50-
2. A maintainer approves the release in the GitHub `Release` environment
51-
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)
52-
4. The `CHANGELOG.md` is updated with a link to the full changelog
53-
5. Changes are committed and pushed to `master`
54-
6. A git tag is created (e.g., `v1.8.0`)
55-
7. A GitHub release is created with the changelog content
56-
8. Slack is notified of the successful release
57-
58-
Releases are installed directly from GitHub.
36+
See [RELEASING.md](RELEASING.md).

RELEASING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Releasing
2+
3+
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.
4+
5+
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.
6+
7+
## Release Process
8+
9+
1. **Create your PR** with the changes you want to release
10+
2. **Add the `release` label** to the PR
11+
3. **Add a version bump label** that should be either `bump-patch`, `bump-minor` or `bump-major`
12+
4. **Merge the PR** to `master`
13+
14+
Once merged, the following happens automatically:
15+
16+
1. A Slack notification is sent to the client libraries channel requesting approval
17+
2. A maintainer approves the release in the GitHub `Release` environment
18+
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)
19+
4. The `CHANGELOG.md` is updated with a link to the full changelog
20+
5. Changes are committed and pushed to `master`
21+
6. A git tag is created (e.g., `v1.8.0`)
22+
7. A GitHub release is created with the changelog content
23+
8. Slack is notified of the successful release
24+
25+
Releases are installed directly from GitHub.

0 commit comments

Comments
 (0)