-
Notifications
You must be signed in to change notification settings - Fork 48
ci: Replace releaser with release please #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Use a step like this to build documentation. | ||
| name: Build Documentation | ||
| description: 'Build Documentation.' | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Build Documentation | ||
| shell: bash | ||
| run: | | ||
| phpdoc \ | ||
| -d src \ | ||
| -t "docs" \ | ||
| --ignore Impl/ \ | ||
| --ignore '*/Impl/' \ | ||
| --ignore-tags psalm-param \ | ||
| --ignore-tags psalm-var \ | ||
| --ignore-tags psalm-return \ | ||
| --visibility public \ | ||
| --defaultpackagename "LaunchDarkly" \ | ||
| --title "LaunchDarkly PHP SDK" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: CI Workflow | ||
| description: 'Shared CI workflow.' | ||
| inputs: | ||
| php-version: | ||
| description: 'Which version of PHP should we setup?' | ||
| required: false | ||
| default: 8.0 | ||
| use-lowest-dependencies: | ||
| description: 'Should we prefer the lowest dependency version?' | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
| token: | ||
| description: 'Token used to prevent composer rate limiting' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 | ||
| with: | ||
| php-version: ${{ inputs.php-version }} | ||
| extensions: xdebug | ||
| tools: phpdoc:3.1.2 | ||
| env: | ||
| GITHUB_TOKEN: ${{ inputs.token }} | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: composer install --no-progress | ||
|
|
||
| - name: Downgrade to lowest versions | ||
| if: ${{ inputs.use-lowest-dependencies }} | ||
| shell: bash | ||
| run: composer update --prefer-lowest --prefer-stable | ||
|
|
||
| - name: Run unit tests | ||
| shell: bash | ||
| run: make test | ||
|
|
||
| - name: Run lint checks | ||
| shell: bash | ||
| run: make lint | ||
|
|
||
| - name: Run contract tests | ||
| shell: bash | ||
| run: make contract-tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| name: Publish Documentation | ||
| description: 'Publish the documentation to GitHub pages' | ||
| inputs: | ||
| token: | ||
| description: 'Token to use for publishing.' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: launchdarkly/gh-actions/actions/[email protected] | ||
| name: 'Publish to Github pages' | ||
| with: | ||
| docs_path: docs | ||
| github_token: ${{ inputs.token }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: Run CI | ||
| on: | ||
| push: | ||
| branches: [ 5.x ] | ||
| paths-ignore: | ||
| - '**.md' # Do not need to run CI for markdown changes. | ||
| pull_request: | ||
| branches: [ 5.x ] | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| jobs: | ||
| linux-build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| wiremock: | ||
| image: wiremock/wiremock | ||
| ports: | ||
| - 8080:8080 | ||
|
|
||
| strategy: | ||
| matrix: | ||
| php-version: [8.0, 8.1] | ||
| use-lowest-dependencies: [true, false] | ||
|
|
||
| env: | ||
| LD_INCLUDE_INTEGRATION_TESTS: 1 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # If you only need the current version keep this. | ||
|
|
||
| - uses: ./.github/actions/ci | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| use-lowest-dependencies: ${{ matrix.use-lowest-dependencies }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| windows-build: | ||
| runs-on: windows-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| php-version: [8.0.30, 8.1.26] | ||
|
|
||
| env: | ||
| LD_INCLUDE_INTEGRATION_TESTS: 1 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # If you only need the current version keep this. | ||
|
|
||
| - name: Install java support | ||
| run: choco install -y javaruntime | ||
|
|
||
| - name: Install php support | ||
| run: choco install -y php --version=${{ matrix.php-version }} --force | ||
|
|
||
| - name: Install composer | ||
| run: choco install -y composer | ||
|
|
||
| - name: Download wiremock | ||
| run: Invoke-WebRequest -Uri https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.31.0/wiremock-jre8-standalone-2.31.0.jar -UseBasicParsing -OutFile wiremock.jar | ||
|
|
||
| - name: Verify checksum | ||
| shell: bash | ||
| run: | | ||
| [ "$(sha256sum wiremock.jar | awk '{ print $1 }')" == "c5cd526e04c57293ec847d845733b017c4052d2132653332e05a54272934a305" ] | ||
|
|
||
| - name: Start wiremock | ||
| run: cmd /c "START /b java -jar ./wiremock.jar" | ||
|
|
||
| - name: Wait for wiremock to be available | ||
| run: PowerShell -Command Start-Sleep -Seconds 5 | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --no-progress | ||
|
|
||
| - name: Run tests | ||
| run: .\vendor\bin\phpunit | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: Lint PR title | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - opened | ||
| - edited | ||
| - synchronize | ||
|
|
||
| jobs: | ||
| lint-pr-title: | ||
| uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| name: Publish Documentation | ||
| jobs: | ||
| build-publish: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| wiremock: | ||
| image: wiremock/wiremock | ||
| ports: | ||
| - 8080:8080 | ||
|
|
||
| env: | ||
| LD_INCLUDE_INTEGRATION_TESTS: 1 | ||
|
|
||
| permissions: | ||
| contents: write # Needed in this case to write github pages. | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Build and Test | ||
| uses: ./.github/actions/ci | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build documentation | ||
| uses: ./.github/actions/build-docs | ||
|
|
||
| - name: Publish Documentation | ||
| uses: ./.github/actions/publish-docs | ||
| with: | ||
| token: ${{secrets.GITHUB_TOKEN}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Run Release Please | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 5.x | ||
|
|
||
| jobs: | ||
| release-package: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: write # Contents and pull-requests are for release-please to make releases. | ||
| pull-requests: write | ||
|
|
||
| services: | ||
| wiremock: | ||
| image: wiremock/wiremock | ||
| ports: | ||
| - 8080:8080 | ||
|
|
||
| env: | ||
| LD_INCLUDE_INTEGRATION_TESTS: 1 | ||
|
|
||
| steps: | ||
| - uses: google-github-actions/release-please-action@v3 | ||
| id: release | ||
| with: | ||
| command: manifest | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| default-branch: 5.x | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| if: ${{ steps.release.outputs.releases_created }} | ||
| with: | ||
| fetch-depth: 0 # If you only need the current version keep this. | ||
|
|
||
| - name: Build and Test | ||
| if: ${{ steps.release.outputs.releases_created }} | ||
| uses: ./.github/actions/ci | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build documentation | ||
| if: ${{ steps.release.outputs.releases_created }} | ||
| uses: ./.github/actions/build-docs | ||
|
|
||
| - uses: ./.github/actions/publish-docs | ||
| if: ${{ steps.release.outputs.releases_created }} | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a SHA we can verify this against?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where they provide one on the site. I could always just do an md5sum on the file locally and then start comparing against that I suppose?