Skip to content

Commit

Permalink
add github actions to release asset
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Jan 18, 2022
1 parent 45402d0 commit 9f09c98
Showing 1 changed file with 42 additions and 12 deletions.
54 changes: 42 additions & 12 deletions .github/workflows/wp-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9f09c98

Please sign in to comment.