diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9556be90..e4a81704 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,3 @@ -* @seba-aln @650elx @raipubnub -.github/* @parfeon @seba-aln @650elx @raipubnub -README.md @techwritermat @kazydek \ No newline at end of file +* @raipubnub @650elx @seba-aln +.travis/* @parfeon @raipubnub @650elx +README.md @techwritermat \ No newline at end of file diff --git a/.github/workflows/commands-handler.yml b/.github/workflows/commands-handler.yml deleted file mode 100644 index e5196c1b..00000000 --- a/.github/workflows/commands-handler.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Commands processor - -on: - issue_comment: - types: [created] - -jobs: - process: - name: Process command - if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, '@client-engineering-bot ') }} - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Checkout release actions - uses: actions/checkout@v2 - with: - repository: pubnub/client-engineering-deployment-tools - ref: v1 - token: ${{ secrets.GH_TOKEN }} - path: .github/.release/actions - - name: Process changelog entries - uses: ./.github/.release/actions/actions/commands - with: - token: ${{ secrets.GH_TOKEN }} - listener: client-engineering-bot - jira-api-key: ${{ secrets.JIRA_API_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 089bf0b4..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Automated product release - -on: - pull_request: - branches: [ master ] - types: [ closed ] - - -jobs: - check-release: - name: Check release required - runs-on: ubuntu-latest - if: ${{ github.event.pull_request.merged && endsWith(github.repository, '-private') != true }} - outputs: - release: ${{ steps.check.outputs.ready }} - steps: - - name: Checkout actions - uses: actions/checkout@v2 - with: - repository: pubnub/client-engineering-deployment-tools - ref: v1 - token: ${{ secrets.GH_TOKEN }} - path: .github/.release/actions - - id: check - name: Check pre-release completed - uses: ./.github/.release/actions/actions/checks/release - with: - token: ${{ secrets.GH_TOKEN }} - publish: - name: Publish package - runs-on: ubuntu-latest - needs: check-release - if: ${{ needs.check-release.outputs.release == 'true' }} - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # This should be the same as the one specified for on.pull_request.branches - ref: master - - name: Checkout actions - uses: actions/checkout@v2 - with: - repository: pubnub/client-engineering-deployment-tools - ref: v1 - token: ${{ secrets.GH_TOKEN }} - path: .github/.release/actions - - name: Publish to Packagist - uses: ./.github/.release/actions/actions/services/composer - with: - token: ${{ secrets.GH_TOKEN }} - packagist-username: ${{ secrets.PACKAGIST_USERNAME }} - packagist-token: ${{ secrets.PACKAGIST_TOKEN }} - - name: Create Release - uses: ./.github/.release/actions/actions/services/github-release - with: - token: ${{ secrets.GH_TOKEN }} - jira-api-key: ${{ secrets.JIRA_API_KEY }} - last-service: true - diff --git a/.github/workflows/release/versions.json b/.github/workflows/release/versions.json deleted file mode 100644 index 91031831..00000000 --- a/.github/workflows/release/versions.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - ".pubnub.yml": [ - { "pattern": "^version: \"(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\"$", "cleared": true }, - { - "pattern": "\\s+package-name: php-(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?).zip$", - "clearedPrefix": true, - "clearedSuffix": false - }, - { "pattern": "pubnub/php/releases/tag/(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)$", "cleared": false } - ], - "README.md": [ - { - "pattern": "^\\s{2,}\"pubnub\/pubnub\": \"(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\"$", - "clearedPrefix": true, - "clearedSuffix": false - } - ], - "composer.json": [ - { - "pattern": "^\\s{2,}\"version\": \"(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\",$", - "clearedPrefix": true, - "clearedSuffix": false - } - ], - "src/PubNub/PubNub.php": [ - { "pattern": "^\\s{2,}const SDK_VERSION = \"(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\";$", - "clearedPrefix": true, - "clearedSuffix": false - } - ] -} diff --git a/.github/workflows/run_acceptance_tests.yml b/.github/workflows/run_acceptance_tests.yml new file mode 100644 index 00000000..446bf00e --- /dev/null +++ b/.github/workflows/run_acceptance_tests.yml @@ -0,0 +1,38 @@ +name: run_acceptance_tests + +on: [push] + +jobs: + build: + name: Perform Acceptance BDD tests + runs-on: ubuntu-latest + steps: + - name: Checkout project + uses: actions/checkout@v2 + - name: Checkout mock-server action + uses: actions/checkout@v2 + with: + repository: pubnub/client-engineering-deployment-tools + ref: github-actions + token: ${{ secrets.GH_TOKEN }} + path: client-engineering-deployment-tools + - name: Run mock server action + uses: ./client-engineering-deployment-tools/actions/mock-server + with: + token: ${{ secrets.GH_TOKEN }} + - name: Install Composer dev depenencies + run: | + COMPOSER=acceptance.json composer install --dev + - name: Run acceptance tests + run: | + mkdir -p tests/features/bootstrap/access/ + mkdir -p tests/features/bootstrap/utilities/ + mkdir -p tests/features/reports + cp sdk-specifications/features/access/grant-token.feature tests/features/bootstrap/access/grant-an-access-token.feature + cp sdk-specifications/features/utilities/time.feature tests/features/bootstrap/utilities/time.feature + vendor/bin/behat -f junit -o tests/features/reports/ + - name: Expose acceptance tests reports + uses: actions/upload-artifact@v2 + with: + name: acceptance-test-reports + path: ./tests/features/reports \ No newline at end of file diff --git a/.gitignore b/.gitignore index 84cc9144..452bc52f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,12 +6,22 @@ # composer vendor dir /vendor -# IDEA files -/.idea +# IDE files +/.id +/.vscode .DS_Store coverage.clover -# GitHub Actions # -################## -.github/.release +.travis/README.md +.travis/scripts + +deployment_keys +deployment_keys-private +deployment_keys.tar + +.travis/github-labels-policy.json +.travis/github-labels.json + +# BEHAT feature files +/tests/features/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index b910137b..00a33c06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,16 @@ language: php dist: xenial os: linux + +env: + global: + - SOURCE_FOLDER_PATH="./" + - TARGET_FOLDER_PATH="./" + +before_install: + - ./.travis/bootstrap.sh + - ./.travis/scripts/key_decrypt.sh deployment_keys.tar deployment_keys $encrypted_2a5fd2384630_key $encrypted_2a5fd2384630_iv + - ./.travis/scripts/git_config.sh install: - composer self-update && composer --version @@ -15,6 +25,21 @@ stages: - name: "code coverage" if: | type == pull_request + - name: "release candidate" + if: | + type != pull_request \ + AND tag IS present \ + AND tag =~ ^v\d+\.\d+\.\d+-rc\.\d+$ + - name: "release" + if: | + type != pull_request \ + AND tag IS present \ + AND tag =~ ^v\d+\.\d+\.\d+$ + - name: "synchronize" + if: | + type != pull_request \ + AND tag IS present \ + AND tag =~ ^v?\d+\.\d+\.\d+-nodeploy\.\d+$ jobs: include: @@ -39,4 +64,16 @@ jobs: php: '7.3' script: vendor/bin/phpunit --verbose --coverage-clover=coverage.xml after_success: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file + - bash <(curl -s https://codecov.io/bash) + - stage: "release candidate" + name: "Deploy release candidate" + php: '7.3' + script: ./.travis/scripts/deploy.sh release-candidate pubnub/php + - stage: "release" + name: "Deploy release" + php: '7.3' + script: ./.travis/scripts/deploy.sh release pubnub/php + - stage: "synchronize" + name: "Not deployable synchronization" + php: '7.3' + script: ./.travis/scripts/synchronization.sh pubnub/php \ No newline at end of file diff --git a/README.md b/README.md index 962a469b..84fe196c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PubNub PHP SDK (V4) -[![Build Status](https://travis-ci.com/pubnub/php.svg?branch=master)](https://travis-ci.com/pubnub/php) +[![Build Status](https://travis-ci.com/pubnub/php-private.svg?token=V4772uMGPqyaA9eaPg8s&branch=master)](https://travis-ci.com/pubnub/php-private) [![codecov](https://codecov.io/gh/pubnub/php/branch/master/graph/badge.svg)](https://codecov.io/gh/pubnub/php) [![Docs](https://img.shields.io/badge/docs-online-blue.svg)](https://www.pubnub.com/docs/php/pubnub-php-sdk) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/pubnub/php) diff --git a/composer.json b/composer.json index cae3605e..df4670ad 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=5.6.0", "rmccue/requests": "^1.0", - "monolog/monolog": "^1.1|^2.0" + "monolog/monolog": "^1.26" }, "require-dev": { "phpunit/phpunit": "^5.7" diff --git a/examples/Time.php b/examples/Time.php index bb1d3cc2..ca865e45 100755 --- a/examples/Time.php +++ b/examples/Time.php @@ -1,6 +1,6 @@