From ba020ecefb38d93bfe000074851974212aeb737b Mon Sep 17 00:00:00 2001 From: David Jensen Date: Fri, 13 Sep 2024 06:32:37 -0400 Subject: [PATCH] feat: scope dependencies BREAKING CHANGE: Scoped dependencies to prevent collisions. References to namespace `\Mpdf` is now `\WCCartPDF\Mpdf` --- .github/workflows/php.yml | 25 +++++++++++++-- .github/workflows/test.yml | 62 -------------------------------------- readme.txt | 3 ++ 3 files changed, 25 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 63d59d8..4e3ec67 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -13,11 +13,30 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Install npm packages + - name: Set-up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.0 + coverage: none + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure GitHub token for Composer + run: composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + + - name: Add private repository to Composer's global config + run: | + composer global config repositories.mozart '{"type": "vcs", "url": "https://github.com/dkjensen/mozart"}' + + - name: Install Mozart globally + run: composer global require dkjensen/mozart:dev-master + + - name: Build release + shell: bash run: | - npm i + npm ci --no-optional - name: Semantic release id: semantic diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 014f467..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Deploy - -on: - pull_request: - branches: - - feature/mozart-deps - push: - branches: - - feature/mozart-deps - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set-up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.0 - coverage: none - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Configure GitHub token for Composer - run: composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} - - - name: Add private repository to Composer's global config - run: | - composer global config repositories.mozart '{"type": "vcs", "url": "https://github.com/dkjensen/mozart"}' - - - name: Install Mozart globally - run: composer global require dkjensen/mozart:dev-master - - - name: Build release - shell: bash - run: | - npm ci --no-optional - npm run plugin-zip - - - name: Upload to File.io - id: upload_file - run: | - response=$(curl -F "file=@build/wc-cart-pdf.zip" https://file.io) - echo "Response: $response" - url=$(echo $response | jq -r '.link') - echo "::set-output name=file_url::$url" - - - name: Email release with File.io link - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.resend.com - server_port: 465 - username: resend - password: ${{ secrets.EMAIL_PASSWORD }} - from: David Jensen - subject: New release of WC Cart PDF - body: | - A new release of WC Cart PDF has been published. - You can download the file from the following link: ${{ steps.upload_file.outputs.file_url }} - to: ${{ secrets.EMAIL }} diff --git a/readme.txt b/readme.txt index dd6b0a7..16247d4 100644 --- a/readme.txt +++ b/readme.txt @@ -29,6 +29,9 @@ Adds ability for users and guests to download their WooCommerce cart as PDF. Use == Changelog == +3.0.0 +* **BREAKING CHANGE**: Scoped dependencies to prevent collisions. References to namespace `\Mpdf` is now `\WCCartPDF\Mpdf` + 2.10.0 * Set minimum compatibility to PHP 8+