From b5f2c1e0e1a7c860fec2c57c711861a47fc51475 Mon Sep 17 00:00:00 2001 From: Bernhard Kau Date: Sat, 14 May 2022 15:39:20 +0200 Subject: [PATCH] adding GitHub actions for first deployment --- .../wordpress-plugin-asset-update.yml | 17 ++++++++ .github/workflows/wordpress-plugin-deploy.yml | 42 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/wordpress-plugin-asset-update.yml create mode 100644 .github/workflows/wordpress-plugin-deploy.yml diff --git a/.github/workflows/wordpress-plugin-asset-update.yml b/.github/workflows/wordpress-plugin-asset-update.yml new file mode 100644 index 0000000..d65de9a --- /dev/null +++ b/.github/workflows/wordpress-plugin-asset-update.yml @@ -0,0 +1,17 @@ +name: Plugin asset/readme update +on: + push: + branches: + - stable +jobs: + stable: + name: Push to trunk + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: WordPress.org plugin asset/readme update + uses: 10up/action-wordpress-plugin-asset-update@stable + env: + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + README_NAME: README.md \ No newline at end of file diff --git a/.github/workflows/wordpress-plugin-deploy.yml b/.github/workflows/wordpress-plugin-deploy.yml new file mode 100644 index 0000000..4ea05b9 --- /dev/null +++ b/.github/workflows/wordpress-plugin-deploy.yml @@ -0,0 +1,42 @@ +name: Deploy to WordPress.org +on: + release: + types: [published] + +jobs: + tag: + name: New release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Composer install + uses: shivammathur/setup-php@v2 + with: + php-version: 5.6 + - run: composer install --no-dev --ignore-platform-reqs --optimize-autoloader + + - name: Assets build + run: | + npm install + npm run build + + - name: WordPress Plugin Deploy + id: deploy + uses: 10up/action-wordpress-plugin-deploy@stable + with: + generate-zip: true + env: + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + 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