Skip to content

Commit 97e130b

Browse files
authored
Merge pull request #35 from Emilia-Capital/jdv/change-deploy
Change deploy method
2 parents bfc091c + 2fc86d6 commit 97e130b

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,44 @@
1-
name: "Deploy to WordPress.org"
1+
name: Deploy to WordPress.org repository
22

33
on:
4-
push:
5-
tags:
6-
- "v*"
4+
release:
5+
types: [released]
76

87
jobs:
9-
tag:
10-
name: New tag
8+
deploy_to_wordpress_org:
9+
name: Deploy release
1110
runs-on: ubuntu-latest
1211
steps:
13-
- uses: actions/checkout@main
14-
- 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
1519
uses: 10up/action-wordpress-plugin-deploy@stable
20+
with:
21+
generate-zip: true
1622
env:
1723
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
1824
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
19-
SLUG: fewer-tags
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: actions/upload-release-asset@v1
29+
env:
30+
# Note, this is an exception to action secrets: GH_TOKEN is always available and provides access to
31+
# the current repository this action runs in.
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
# Get the URL for uploading assets to the current release.
35+
upload_url: ${{ github.event.release.upload_url }}
36+
37+
# Provide the path to the file generated in the previous step using the output and the id of the step.
38+
asset_path: ${{ steps.deploy.outputs.zip-path }}
39+
40+
# Provide what the file should be named when attached to the release (plugin-name.zip)
41+
asset_name: ${{ github.event.repository.name }}.zip
42+
43+
# Provide the file type.
44+
asset_content_type: application/zip

0 commit comments

Comments
 (0)