From 9f09c986d30f8a438cc9a25f6c62518ef0bfc302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tetsuaki=20Hamano=20/=20=E6=B5=9C=E9=87=8E=20=E5=93=B2?= =?UTF-8?q?=E6=98=8E?= Date: Tue, 18 Jan 2022 01:48:07 +0000 Subject: [PATCH] add github actions to release asset --- .github/workflows/wp-plugin-deploy.yml | 54 ++++++++++++++++++++------ 1 file changed, 42 insertions(+), 12 deletions(-) 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