diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 495203af..fbd33a94 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,10 +1,7 @@ name: Deploy -# Run deploy only on tag and master builds. +# Run deploy only on publised releases. on: - push: - branches: - - master release: types: [published] @@ -32,15 +29,24 @@ jobs: - name: Install NPM dependencies run: npm install - - name: Authenticate with WordPress.org SVN - run: svn info --non-interactive --username "${{ secrets.SVN_USERNAME }}" --password "${{ secrets.SVN_PASSWORD }}" https://plugins.svn.wordpress.org/two-factor/ + - name: Build plugin + run: npm run build + - name: WordPress Plugin Deploy + id: deploy + uses: 10up/action-wordpress-plugin-deploy@stable + with: + generate-zip: true + env: + BUILD_DIR: dist + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} - - name: Deploy to WordPress.org SVN + - name: Upload release asset + uses: actions/upload-release-asset@v1 env: - DEPLOY_SVN_USERNAME: ${{ secrets.SVN_USERNAME }} - DEPLOY_TRUNK: ${{ contains( github.ref_name, 'master' ) }} - DEPLOY_TAG: ${{ contains( github.ref_type, 'tag' ) }} - DEPLOY_SKIP_CONFIRMATION: true - # Disable deployments while they are failing for unknown reason. - if: env.DEPLOY_SVN_USERNAME && false - run: npm run deploy + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ steps.deploy.outputs.zip-path }} + asset_name: ${{ github.event.repository.name }}.zip + asset_content_type: application/zip