diff --git a/.github/workflows/wp-plugin-deploy.yml b/.github/workflows/wp-plugin-deploy.yml index 113a106..8fc3d16 100644 --- a/.github/workflows/wp-plugin-deploy.yml +++ b/.github/workflows/wp-plugin-deploy.yml @@ -3,18 +3,48 @@ on: push: tags: - "*" + jobs: - tag: - name: New tag + deploy: + name: Deploy to WP.org runs-on: ubuntu-latest steps: - - uses: actions/checkout@main - - name: Build - run: | - npm install - npm run build - - name: WordPress Plugin Deploy - uses: 10up/action-wordpress-plugin-deploy@stable - env: - SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} - SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + - name: Checkout + uses: actions/checkout@main + + - name: Build + run: | + npm ci + npm run build + + - name: WordPress Plugin Deploy + id: deploy + uses: 10up/action-wordpress-plugin-deploy@stable + with: + generate-zip: true + env: + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SLUG: flexible-spacer-block + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + commitish: main + + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ steps.deploy.outputs.zip-path }} + asset_name: ${{ github.event.repository.name }}.zip + asset_content_type: application/zip