-
Notifications
You must be signed in to change notification settings - Fork 96
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
4 changed files
with
143 additions
and
49 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Contributing and Maintaining | ||
|
||
First, thank you for taking the time to contribute! | ||
|
||
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. | ||
|
||
## Ways to contribute | ||
|
||
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: | ||
|
||
### Reporting bugs | ||
|
||
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. | ||
|
||
### Suggesting enhancements | ||
|
||
New features and enhancements are also managed via [issues](https://github.com/10up/action-wordpress-plugin-deploy/issues). | ||
|
||
### Pull requests | ||
|
||
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. | ||
|
||
For more on how 10up writes and manages code, check out our [10up Engineering Best Practices](https://10up.github.io/Engineering-Best-Practices/). | ||
|
||
## Workflow | ||
|
||
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. | ||
|
||
## Release instructions | ||
|
||
1. [Create a new release](https://github.com/10up/action-wordpress-plugin-deploy/releases/new) | ||
2. Ensure it appears in the GitHub Marketplace correctly | ||
3. Celebrate shipping! |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Helen Hou-Sandi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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
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 |
---|---|---|
|
@@ -20,11 +20,6 @@ if [[ -z "$SVN_PASSWORD" ]]; then | |
exit 1 | ||
fi | ||
|
||
if [[ -z "$GITHUB_TOKEN" ]]; then | ||
echo "Set the GITHUB_TOKEN env variable" | ||
exit 1 | ||
fi | ||
|
||
# Allow some ENV variables to be customized | ||
if [[ -z "$SLUG" ]]; then | ||
SLUG=${GITHUB_REPOSITORY#*/} | ||
|
@@ -54,39 +49,48 @@ svn update --set-depth infinity assets | |
svn update --set-depth infinity trunk | ||
|
||
echo "➤ Copying files..." | ||
cd "$GITHUB_WORKSPACE" | ||
|
||
# "Export" a cleaned copy to a temp directory | ||
TMP_DIR="/github/archivetmp" | ||
mkdir "$TMP_DIR" | ||
|
||
git config --global user.email "[email protected]" | ||
git config --global user.name "10upbot on GitHub" | ||
|
||
# If there's no .gitattributes file, write a default one into place | ||
if [[ ! -e "$GITHUB_WORKSPACE/.gitattributes" ]]; then | ||
cat > "$GITHUB_WORKSPACE/.gitattributes" <<-EOL | ||
/$ASSETS_DIR export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.github export-ignore | ||
EOL | ||
|
||
# Ensure we are in the $GITHUB_WORKSPACE directory, just in case | ||
# The .gitattributes file has to be committed to be used | ||
# Just don't push it to the origin repo :) | ||
git add .gitattributes && git commit -m "Add .gitattributes file" | ||
if [[ -e "$GITHUB_WORKSPACE/.distignore" ]]; then | ||
echo "ℹ︎ Using .distignore" | ||
# Copy from current branch to /trunk, excluding dotorg assets | ||
# The --delete flag will delete anything in destination that no longer exists in source | ||
rsync -rc --exclude-from="$GITHUB_WORKSPACE/.distignore" "$GITHUB_WORKSPACE/" trunk/ --delete | ||
else | ||
echo "ℹ︎ Using .gitattributes" | ||
|
||
cd "$GITHUB_WORKSPACE" | ||
|
||
# "Export" a cleaned copy to a temp directory | ||
TMP_DIR="/github/archivetmp" | ||
mkdir "$TMP_DIR" | ||
|
||
git config --global user.email "[email protected]" | ||
git config --global user.name "10upbot on GitHub" | ||
|
||
# If there's no .gitattributes file, write a default one into place | ||
if [[ ! -e "$GITHUB_WORKSPACE/.gitattributes" ]]; then | ||
cat > "$GITHUB_WORKSPACE/.gitattributes" <<-EOL | ||
/$ASSETS_DIR export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.github export-ignore | ||
EOL | ||
|
||
# Ensure we are in the $GITHUB_WORKSPACE directory, just in case | ||
# The .gitattributes file has to be committed to be used | ||
# Just don't push it to the origin repo :) | ||
git add .gitattributes && git commit -m "Add .gitattributes file" | ||
fi | ||
|
||
# This will exclude everything in the .gitattributes file with the export-ignore flag | ||
git archive HEAD | tar x --directory="$TMP_DIR" | ||
|
||
cd "$SVN_DIR" | ||
|
||
# Copy from clean copy to /trunk, excluding dotorg assets | ||
# The --delete flag will delete anything in destination that no longer exists in source | ||
rsync -rc "$TMP_DIR/" trunk/ --delete | ||
fi | ||
|
||
# This will exclude everything in the .gitattributes file with the export-ignore flag | ||
git archive HEAD | tar x --directory="$TMP_DIR" | ||
|
||
cd "$SVN_DIR" | ||
|
||
# Copy from clean copy to /trunk, excluding dotorg assets | ||
# The --delete flag will delete anything in destination that no longer exists in source | ||
rsync -rc "$TMP_DIR/" trunk/ --delete | ||
|
||
# Copy dotorg assets to /assets | ||
rsync -rc "$GITHUB_WORKSPACE/$ASSETS_DIR/" assets/ --delete | ||
|
||
|