You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thank you for taking the time to contribute!
4
+
5
+
The following is a set of guidelines for contributors as well as information and instructions around our maintenance process. The two are closely tied together in terms of how we all work together and set expectations, so while you may not need to know everything in here to submit an issue or pull request, it's best to keep them in the same document.
6
+
7
+
## Ways to contribute
8
+
9
+
Contributing isn't just writing code - it's anything that improves the project. All contributions for our GitHub Actions for WordPress are managed right here on GitHub. Here are some ways you can help:
10
+
11
+
### Reporting bugs
12
+
13
+
If you're running into an issue with the action, please take a look through [existing issues](https://github.com/10up/action-wordpress-plugin-deploy/issues) and [open a new one](https://github.com/10up/action-wordpress-plugin-deploy/issues/new) if needed. If you're able, include a link to the log output from the failed run.
14
+
15
+
### Suggesting enhancements
16
+
17
+
New features and enhancements are also managed via [issues](https://github.com/10up/action-wordpress-plugin-deploy/issues).
18
+
19
+
### Pull requests
20
+
21
+
Pull requests represent a proposed solution to a specified problem. They should always reference an issue that describes the problem and contains discussion about the problem itself. Discussion on pull requests should be limited to the pull request itself, i.e. code review.
22
+
23
+
For more on how 10up writes and manages code, check out our [10up Engineering Best Practices](https://10up.github.io/Engineering-Best-Practices/).
24
+
25
+
## Workflow
26
+
27
+
This repository currently uses the `develop` branch to reflect active work and `master` to represent the latest tagged release. Both should typically be usable and frequently the same, but we request that pull requests be opened against `develop` and usage of the action be against `master` or a specific tag. New releases will be tagged as updates are made.
28
+
29
+
## Release instructions
30
+
31
+
1.[Create a new release](https://github.com/10up/action-wordpress-plugin-deploy/releases/new)
32
+
2. Ensure it appears in the GitHub Marketplace correctly
This Action commits the contents of your Git tag to the WordPress.org plugin repository using the same tag name. It excludes files in `.git` and `.github` subdirectories and moves anything from a `.wordpress-org` subdirectory to the top-level `assets` directory in Subversion (plugin banners, icons, and screenshots).
3
+
This Action commits the contents of your Git tag to the WordPress.org plugin repository using the same tag name. It can exclude files as defined in either `.distignore` or `.gitattributes`, and moves anything from a `.wordpress-org` subdirectory to the top-level `assets` directory in Subversion (plugin banners, icons, and screenshots).
4
+
5
+
### ☞ For updating the readme and items in the assets directory between releases, please see our [WordPress.org Plugin Readme/Assets Update Action](https://github.com/10up/action-wordpress-plugin-asset-update)
4
6
5
7
## Configuration
6
8
7
9
### Required secrets
8
10
*`SVN_USERNAME`
9
11
*`SVN_PASSWORD`
10
-
*`GITHUB_TOKEN` - you do not need to generate one but you do have to explicitly make it available to the Action
11
12
12
-
Secrets can be set while editing your workflow or in the repository settings. They cannot be viewed once stored. [GitHub secrets documentation](https://developer.github.com/actions/creating-workflows/storing-secrets/)
13
+
[Secrets are set in your repository settings](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables). They cannot be viewed once stored.
13
14
14
15
### Optional environment variables
15
-
*`SLUG` - defaults to the respository name, customizable in case your WordPress repository has a different slug. This should be a very rare case as WordPress assumes that the directory and initial plugin file have the same slug.
16
-
*`VERSION` - defaults to the tag name; do not recommend setting this except for testing purposes
17
-
*`ASSETS_DIR` - defaults to `.wordpress-org`, customizable for other locations of WordPress.org plugin repository-specific assets that belong in the top-level `assets` directory (the one on the same level as `trunk`)
16
+
*`SLUG` - defaults to the repository name, customizable in case your WordPress repository has a different slug or is capitalized differently.
17
+
*`VERSION` - defaults to the tag name; do not recommend setting this except for testing purposes.
18
+
*`ASSETS_DIR` - defaults to `.wordpress-org`, customizable for other locations of WordPress.org plugin repository-specific assets that belong in the top-level `assets` directory (the one on the same level as `trunk`).
18
19
19
-
### Known issues
20
-
* Currently the `tags` filter on the `push` action does not seem to work correctly, so we target the `refs/tags/*` naming of a branch instead. Ideally for readability and correctness this would use something like `tags: - *`.
20
+
##Excluding files from deployment
21
+
If there are files or directories to be excluded from deployment, such as tests or editor config files, they can be specified in either a `.distignore` file or a `.gitattributes` file using the `export-ignore` directive. If a `.distignore` file is present, it will be used; if not, the Action will look for a `.gitattributes` file and barring that, will write a basic temporary `.gitattributes` into place before proceeding so that no Git/GitHub-specific files are included.
21
22
22
-
## Example Workflow File
23
+
`.distignore` is useful particularly when there are built files that are in `.gitignore`, and is a file that is used in [WP-CLI](https://wp-cli.org/). For modern plugin setups with a build step and no built files committed to the repository, this is the way forward. `.gitattributes` is useful for plugins that don't run a build step as a part of the Actions workflow and also allows for GitHub's generated ZIP files to contain the same contents as what is committed to WordPress.org. If you would like to attach a ZIP file with the proper contents that decompresses to a folder name without version number as WordPress generally expects, you can add steps to your workflow that generate the ZIP and attach it to the GitHub release (concrete examples to come).
24
+
25
+
### Sample baseline files
26
+
27
+
#### `.distignore`
28
+
29
+
**Notes:**`.distignore` is for files to be ignored **only**; it does not currently allow negation like `.gitignore`. This comes from its current expected syntax in WP-CLI's [`wp dist-archive` command](https://github.com/wp-cli/dist-archive-command/). It is possible that this Action will allow for includes via something like a `.distinclude` file in the future, or that WP-CLI itself makes a change that this Action will reflect for consistency. It also will need to contain more than `.gitattributes` because that method **also** respects `.gitignore`.
30
+
31
+
```
32
+
/.wordpress-org
33
+
/.git
34
+
/.github
35
+
/node_modules
36
+
37
+
.distignore
38
+
.gitignore
23
39
```
40
+
41
+
#### `.gitattributes`
42
+
43
+
```gitattributes
44
+
# Directories
45
+
/.wordpress-org export-ignore
46
+
/.github export-ignore
47
+
48
+
# Files
49
+
/.gitattributes export-ignore
50
+
/.gitignore export-ignore
51
+
```
52
+
53
+
54
+
## Example Workflow File
55
+
```yml
24
56
name: Deploy to WordPress.org
25
57
on:
26
58
push:
27
-
branches:
28
-
- refs/tags/*
59
+
tags:
60
+
- "*"
29
61
jobs:
30
62
tag:
31
63
name: New tag
32
64
runs-on: ubuntu-latest
33
65
steps:
34
66
- uses: actions/checkout@master
67
+
- name: Build
68
+
run: |
69
+
npm install
70
+
npm run build
35
71
- name: WordPress Plugin Deploy
36
72
uses: 10up/action-wordpress-plugin-deploy@master
37
73
env:
38
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39
74
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
40
75
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
41
76
SLUG: my-super-cool-plugin
42
77
```
43
78
44
79
## Contributing
45
-
Want to help? Check out our [contributing guidelines](../CONTRIBUTING.md) to get started.
80
+
Want to help? Check out our [contributing guidelines](CONTRIBUTING.md) to get started.
0 commit comments