-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,33 @@ | ||
name: "Deploy to WordPress.org and create release on GitHub" | ||
name: Deploy to WordPress.org repository | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tags: | ||
description: 'Tag to run for' | ||
push: | ||
tags: | ||
- "v*" | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
tag: | ||
name: New tag | ||
deploy_to_wordpress_org: | ||
name: Deploy release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Build | ||
run: | | ||
composer install --no-dev --prefer-dist --optimize-autoloader --no-scripts | ||
yarn install | ||
grunt build | ||
- name: WordPress Plugin Deploy | ||
# Checkout the code | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
# Optional: if we add a build step to the plugin, we can run it here. | ||
# Deploy the plugin to WordPress.org | ||
- name: WordPress plugin deploy | ||
id: deploy | ||
uses: 10up/action-wordpress-plugin-deploy@stable | ||
with: | ||
generate-zip: true | ||
env: | ||
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | ||
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | ||
SLUG: yoast-comment-hacks # optional, remove if GitHub repo name matches SVN slug, including capitalization | ||
build: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@main | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
# After the deploy, we also want to create a zip and upload it to the release on Github. We don't want | ||
# users to have to go to the repository to find our plugin :). | ||
- name: Upload release asset | ||
uses: Shopify/upload-to-release@master | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
name: ${{ github.event.repository.name }}.zip | ||
path: ${{ steps.deploy.outputs.zip-path }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
content-type: application/zip |