Skip to content

Commit 9e77037

Browse files
authored
ci: Replace releaser with release please (#17)
1 parent 09ace06 commit 9e77037

File tree

16 files changed

+265
-81
lines changed

16 files changed

+265
-81
lines changed

.circleci/config.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build Documentation
2+
description: 'Build Documentation.'
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Build Documentation
8+
shell: bash
9+
run: |
10+
phpdoc \
11+
-d src \
12+
-t "docs" \
13+
--ignore Impl/ \
14+
--ignore '*/Impl/' \
15+
--ignore-tags psalm-param \
16+
--ignore-tags psalm-var \
17+
--ignore-tags psalm-return \
18+
--visibility public \
19+
--defaultpackagename "LaunchDarkly" \
20+
--title "LaunchDarkly PHP SDK phpredis integration"

.github/actions/ci/action.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI Workflow
2+
description: 'Shared CI workflow.'
3+
inputs:
4+
php-version:
5+
description: 'Which version of PHP should we setup?'
6+
required: false
7+
default: 7.4
8+
use-lowest-dependencies:
9+
description: 'Should we prefer the lowest dependency version?'
10+
type: boolean
11+
required: false
12+
default: false
13+
shared-test-version:
14+
description: 'Which version of the shared test package should we required'
15+
required: false
16+
default: 4.x-dev
17+
token:
18+
description: 'Token used to prevent composer rate limiting'
19+
required: true
20+
21+
runs:
22+
using: composite
23+
steps:
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35
26+
with:
27+
php-version: ${{ inputs.php-version }}
28+
tools: phpdoc:3.1.2
29+
env:
30+
GITHUB_TOKEN: ${{ inputs.token }}
31+
32+
- name: Install dependencies
33+
shell: bash
34+
run: composer install --no-progress
35+
36+
- name: Require appropriate shared tests package
37+
shell: bash
38+
run: composer require --dev 'launchdarkly/server-sdk-shared-tests:${{ inputs.shared-test-version }}'
39+
40+
- name: Downgrade to lowest versions
41+
if: ${{ inputs.use-lowest-dependencies }}
42+
shell: bash
43+
run: composer update --prefer-lowest --prefer-stable
44+
45+
- name: Run unit tests
46+
shell: bash
47+
run: ./vendor/bin/phpunit
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Publish Documentation
2+
description: 'Publish the documentation to GitHub pages'
3+
inputs:
4+
token:
5+
description: 'Token to use for publishing.'
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1
12+
name: 'Publish to Github pages'
13+
with:
14+
docs_path: docs
15+
github_token: { token } # For the shared action the token should be a GITHUB_TOKEN

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Run CI
2+
on:
3+
push:
4+
branches: [ main ]
5+
paths-ignore:
6+
- '**.md' # Do not need to run CI for markdown changes.
7+
pull_request:
8+
branches: [ main ]
9+
paths-ignore:
10+
- '**.md'
11+
12+
jobs:
13+
ci-build:
14+
runs-on: ubuntu-latest
15+
16+
services:
17+
redis:
18+
image: redis
19+
ports:
20+
- 6379:6379
21+
22+
strategy:
23+
matrix:
24+
include:
25+
# 7.x configurations
26+
- php-version: 7.3
27+
use-lowest-dependencies: true
28+
shared-test-version: 4.x-dev
29+
- php-version: 7.3
30+
use-lowest-dependencies: false
31+
shared-test-version: 4.x-dev
32+
33+
- php-version: 7.4
34+
use-lowest-dependencies: true
35+
shared-test-version: 4.x-dev
36+
- php-version: 7.4
37+
use-lowest-dependencies: false
38+
shared-test-version: 4.x-dev
39+
40+
# 8.0 configurations
41+
- php-version: 8.0
42+
use-lowest-dependencies: true
43+
shared-test-version: 4.x-dev
44+
- php-version: 8.0
45+
use-lowest-dependencies: false
46+
shared-test-version: 5.x-dev
47+
48+
# 8.1 configurations
49+
- php-version: 8.1
50+
use-lowest-dependencies: true
51+
shared-test-version: 4.x-dev
52+
- php-version: 8.1
53+
use-lowest-dependencies: false
54+
shared-test-version: 5.x-dev
55+
- php-version: 8.1
56+
use-lowest-dependencies: false
57+
shared-test-version: dev-main
58+
59+
# 8.2 configurations
60+
- php-version: 8.2
61+
use-lowest-dependencies: false
62+
shared-test-version: 5.x-dev
63+
- php-version: 8.2
64+
use-lowest-dependencies: false
65+
shared-test-version: dev-main
66+
67+
steps:
68+
- uses: actions/checkout@v4
69+
with:
70+
fetch-depth: 0 # If you only need the current version keep this.
71+
72+
- uses: ./.github/actions/ci
73+
with:
74+
php-version: ${{ matrix.php-version }}
75+
use-lowest-dependencies: ${{ matrix.use-lowest-dependencies }}
76+
shared-test-version: ${{ matrix.shared-test-version }}
77+
token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint PR title
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
lint-pr-title:
12+
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
workflow_dispatch:
3+
4+
name: Publish Documentation
5+
jobs:
6+
build-publish:
7+
runs-on: ubuntu-latest
8+
9+
services:
10+
redis:
11+
image: redis
12+
ports:
13+
- 6379:6379
14+
15+
permissions:
16+
contents: write # Needed in this case to write github pages.
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Build and Test
22+
uses: ./.github/actions/ci
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Build documentation
27+
uses: ./.github/actions/build-docs
28+
29+
- name: Publish Documentation
30+
uses: ./.github/actions/publish-docs
31+
with:
32+
token: ${{secrets.GITHUB_TOKEN}}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Run Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release-package:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # Contents and pull-requests are for release-please to make releases.
13+
pull-requests: write
14+
15+
services:
16+
redis:
17+
image: redis
18+
ports:
19+
- 6379:6379
20+
21+
steps:
22+
- uses: google-github-actions/release-please-action@v3
23+
id: release
24+
with:
25+
command: manifest
26+
token: ${{secrets.GITHUB_TOKEN}}
27+
default-branch: main
28+
29+
- uses: actions/checkout@v4
30+
if: ${{ steps.release.outputs.releases_created }}
31+
with:
32+
fetch-depth: 0 # If you only need the current version keep this.
33+
34+
- name: Build and Test
35+
if: ${{ steps.release.outputs.releases_created }}
36+
uses: ./.github/actions/ci
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Build documentation
41+
if: ${{ steps.release.outputs.releases_created }}
42+
uses: ./.github/actions/build-docs
43+
44+
- uses: ./.github/actions/publish-docs
45+
if: ${{ steps.release.outputs.releases_created }}
46+
with:
47+
token: ${{secrets.GITHUB_TOKEN}}

.ldrelease/config.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.
-483 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)