Merge pull request #41 from hametuha/feature/layout-blocks #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Plugin | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
pre_release: | |
name: Create Release | |
if: contains(github.ref, 'tags/') | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.export.outputs.upload_url }} | |
steps: | |
- uses: actions/checkout@main | |
- 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 Hamail ${{ github.ref }} | |
body: | | |
Release Hamail version ${{ github.ref }}. | |
draft: false | |
prerelease: false | |
- name: Export Upload URL | |
id: export | |
run: echo "::set-output name=upload_url::${{ steps.create_release.outputs.upload_url }}" | |
release: | |
name: Build Plugin | |
needs: pre_release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Confirm | |
run: echo ${{ needs.pre_release.outputs.upload_url }} | |
- name: Setup PHP with composer | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.2 | |
tools: composer | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install NPM | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '20' | |
- name: Build package. | |
run: bash bin/build.sh ${{ github.ref }} | |
- name: Cleanup package. | |
run: bash bin/clean.sh | |
- name: Create Zip | |
run: zip -r hamail.zip ./ | |
- name: Upload Release Zip | |
id: upload-release-asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.pre_release.outputs.upload_url }} | |
asset_path: ./hamail.zip | |
asset_name: hamail.zip | |
asset_content_type: application/zip | |
wp_org: | |
name: Deploy WordPress.org | |
needs: pre_release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Setup PHP with composer | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.2 | |
tools: composer | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install NPM | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '20' | |
- name: Build package. | |
run: bash bin/build.sh ${{ github.ref }} | |
- name: WordPress Plugin Deploy | |
id: deploy | |
uses: 10up/action-wordpress-plugin-deploy@stable | |
with: | |
generate-zip: false | |
env: | |
SVN_USERNAME: ${{ secrets.WP_ORG_USERNAME }} | |
SVN_PASSWORD: ${{ secrets.WP_ORG_PASSWORD }} | |
SLUG: hamail |