Skip to content

Commit ba33c4c

Browse files
committed
Fix deploy workflow
1 parent 563ea35 commit ba33c4c

File tree

1 file changed

+22
-33
lines changed

1 file changed

+22
-33
lines changed

.github/workflows/deploy.yml

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,33 @@
1-
name: "Deploy to WordPress.org and create release on GitHub"
1+
name: Deploy to WordPress.org repository
22

33
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]
116

127
jobs:
13-
tag:
14-
name: New tag
8+
deploy_to_wordpress_org:
9+
name: Deploy release
1510
runs-on: ubuntu-latest
1611
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
2419
uses: 10up/action-wordpress-plugin-deploy@stable
20+
with:
21+
generate-zip: true
2522
env:
2623
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
2724
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
4029
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

Comments
 (0)