|
1 |
| -name: "Deploy to WordPress.org and create release on GitHub" |
| 1 | +name: Deploy to WordPress.org repository |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - workflow_dispatch: |
5 |
| - inputs: |
6 |
| - tags: |
7 |
| - description: 'Tag to run for' |
8 |
| - push: |
9 |
| - tags: |
10 |
| - - "v*" |
| 4 | + release: |
| 5 | + types: [released] |
11 | 6 |
|
12 | 7 | jobs:
|
13 |
| - tag: |
14 |
| - name: New tag |
| 8 | + deploy_to_wordpress_org: |
| 9 | + name: Deploy release |
15 | 10 | runs-on: ubuntu-latest
|
16 | 11 | steps:
|
17 |
| - - uses: actions/checkout@main |
18 |
| - - name: Build |
19 |
| - run: | |
20 |
| - composer install --no-dev --prefer-dist --optimize-autoloader --no-scripts |
21 |
| - yarn install |
22 |
| - grunt build |
23 |
| - - name: WordPress Plugin Deploy |
| 12 | + # Checkout the code |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v4 |
| 15 | + # Optional: if we add a build step to the plugin, we can run it here. |
| 16 | + # Deploy the plugin to WordPress.org |
| 17 | + - name: WordPress plugin deploy |
| 18 | + id: deploy |
24 | 19 | uses: 10up/action-wordpress-plugin-deploy@stable
|
| 20 | + with: |
| 21 | + generate-zip: true |
25 | 22 | env:
|
26 | 23 | SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
|
27 | 24 | SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
|
28 |
| - SLUG: yoast-comment-hacks # optional, remove if GitHub repo name matches SVN slug, including capitalization |
29 |
| - build: |
30 |
| - name: Create Release |
31 |
| - runs-on: ubuntu-latest |
32 |
| - steps: |
33 |
| - - name: Checkout code |
34 |
| - uses: actions/checkout@main |
35 |
| - - name: Create Release |
36 |
| - id: create_release |
37 |
| - uses: actions/create-release@v1 |
38 |
| - env: |
39 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 25 | + # After the deploy, we also want to create a zip and upload it to the release on Github. We don't want |
| 26 | + # users to have to go to the repository to find our plugin :). |
| 27 | + - name: Upload release asset |
| 28 | + uses: Shopify/upload-to-release@master |
40 | 29 | with:
|
41 |
| - tag_name: ${{ github.ref }} |
42 |
| - release_name: Release ${{ github.ref }} |
43 |
| - draft: false |
44 |
| - prerelease: false |
| 30 | + name: ${{ github.event.repository.name }}.zip |
| 31 | + path: ${{ steps.deploy.outputs.zip-path }} |
| 32 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + content-type: application/zip |
0 commit comments