diff --git a/CHANGELOG.md b/CHANGELOG.md index 8316a4d..0467012 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] - TBD +## [2.2.1] - 2023-09-05 +### Fixed +- Ensure built files are included when used without a `BUILD_DIR` and `.distignore` file (props [@akirk](https://github.com/akirk), [@iamdharmesh](https://github.com/iamdharmesh) via [#130](https://github.com/10up/action-wordpress-plugin-deploy/pull/130)). +- Ensure a zip is generated when an existing version is found and the `generate-zip` input is set to `true` (props [@sy-records](https://github.com/sy-records), [@faisal-alvi](https://github.com/faisal-alvi) via [#133](https://github.com/10up/action-wordpress-plugin-deploy/pull/133)). + ## [2.2.0] - 2023-05-18 ### Added - `DRY RUN` mode support that can be used while testing this action (props [@mukeshpanchal27](https://github.com/mukeshpanchal27), [@joemcgill](https://github.com/joemcgill), [@felixarntz](https://github.com/felixarntz), [@jeffpaul](https://github.com/jeffpaul), [@aaemnnosttv](https://github.com/aaemnnosttv), [@dkotter](https://github.com/dkotter), [@stephywells](https://github.com/stephywells) via [#122](https://github.com/10up/action-wordpress-plugin-deploy/pull/122), [#127](https://github.com/10up/action-wordpress-plugin-deploy/pull/127)). @@ -74,6 +79,7 @@ All notable changes to this project will be documented in this file, per [the Ke - Use more robust method of copying files (`-c` flag for `rsync`). [Unreleased]: https://github.com/10up/action-wordpress-plugin-deploy/compare/stable...develop +[2.2.1]: https://github.com/10up/action-wordpress-plugin-deploy/compare/2.2.0...2.2.1 [2.2.0]: https://github.com/10up/action-wordpress-plugin-deploy/compare/2.1.1...2.2.0 [2.1.1]: https://github.com/10up/action-wordpress-plugin-deploy/compare/2.1.0...2.1.1 [2.1.0]: https://github.com/10up/action-wordpress-plugin-deploy/compare/2.0.0...2.1.0 diff --git a/CREDITS.md b/CREDITS.md index dc317c3..92e7769 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -10,7 +10,7 @@ The following individuals are responsible for curating the list of issues, respo Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc. -[Mark Jaquith (@markjaquith)](https://github.com/markjaquith), [Ciprian Popescu (@wolffe)](https://github.com/wolffe), [Léo Colombaro (@LeoColomb)](https://github.com/LeoColomb), [Helen Hou-Sandi (@helen)](https://github.com/helen), [Vincenzo Russo (@vincenzo)](https://github.com/vincenzo), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Nikhil (@Nikschavan)](https://github.com/Nikschavan), [Niels Lange (@nielslange)](https://github.com/nielslange), [Stiofan O'Connor (@Stiofan)](https://github.com/Stiofan), [Sébastien SERRE (@sebastienserre)](https://github.com/sebastienserre), [Ram Ratan Maurya (@mauryaratan)](https://github.com/mauryaratan), [Johannes Siipola (@joppuyo)](https://github.com/joppuyo), [Felipe Elia (@felipeelia)](https://github.com/felipeelia), [Mobeen Abdullah (@mobeenabdullah)](https://github.com/mobeenabdullah), [Gaya Kessler (@Gaya)](https://github.com/Gaya), [Viktor Szépe (@szepeviktor)](https://github.com/szepeviktor), [Grégory Viguier (@Screenfeed)](https://github.com/Screenfeed), [Pascal Knecht (@pascalknecht)](https://github.com/pascalknecht), [Stanislav Khromov (@khromov)](https://github.com/khromov), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Jakub Mikita (@Kubitomakita)](https://github.com/Kubitomakita), [Lucas Bustamante (@Luc45)](https://github.com/Luc45), [Thien Nguyen (@tatthien-zz)](https://github.com/tatthien-zz), [Shiva Poudel (@shivapoudel)](https://github.com/shivapoudel), [null (@nextgenthemes)](https://github.com/nextgenthemes), [Tom Usborne (@tomusborne)](https://github.com/tomusborne), [dean shmuel (@deanshmuel)](https://github.com/deanshmuel), [Peter Adams (@padams)](https://github.com/padams), [Kevin Batdorf (@KevinBatdorf)](https://github.com/KevinBatdorf), [Q (@qstudio)](https://github.com/qstudio), [null (@om4csaba)](https://github.com/om4csaba), [Roman Sapezhko (@shmidtelson)](https://github.com/shmidtelson), [null (@luizkim)](https://github.com/luizkim), [René Hermenau (@rene-hermenau)](https://github.com/rene-hermenau), [Lewis Cowles (@Lewiscowles1986)](https://github.com/Lewiscowles1986), [Dominik Schilling (@ocean90)](https://github.com/ocean90), [Santiago Becerra (@sanbec)](https://github.com/sanbec), [Marijn Bent (@marijnbent)](https://github.com/marijnbent), [Jasan (@jasan-s)](https://github.com/jasan-s), [Dale Nguyen (@dalenguyen)](https://github.com/dalenguyen), [Darren Cooney (@dcooney)](https://github.com/dcooney), [Karolína Vyskočilová (@vyskoczilova)](https://github.com/vyskoczilova), [Rafał Sztwiorok (@sztwiorok)](https://github.com/sztwiorok), [Alec Rust (@AlecRust)](https://github.com/AlecRust), [Jonny Harris (@spacedmonkey)](https://github.com/spacedmonkey), [Doeke Norg (@doekenorg)](https://github.com/doekenorg), [Andrew Heberle (@andrewheberle)](https://github.com/andrewheberle), [Takashi Hosoya (@tkc49)](https://github.com/tkc49), [Fabian Marz (@fabianmarz)](https://github.com/fabianmarz), [David Herron (@robogeek)](https://github.com/robogeek), [Sergey Kotlov (@sery0ga)](https://github.com/sery0ga), [Samuel Wood (@Otto42)](https://github.com/Otto42), [IgorChernenko (@igorchernenko92)](https://github.com/igorchernenko92), [Richard Muvirimi (@richard-muvirimi)](https://github.com/richard-muvirimi), [Dani Llewellyn (@diddledani)](https://github.com/diddledani), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Mukesh Panchal (@mukeshpanchal27)](https://github.com/mukeshpanchal27), [Joe McGill (@joemcgill)](https://github.com/joemcgill), [Felix Arntz (@felixarntz)](https://github.com/felixarntz), [Evan Mattson (@aaemnnosttv)](https://github.com/aaemnnosttv), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Stephanie Wells (@stephywells)](https://github.com/stephywells), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Jason Adams (@JasonTheAdams)](https://github.com/JasonTheAdams), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Uriahs Victor (@UVLabs)](https://github.com/UVLabs), [Simon Dowdles (@10upsimon)](https://github.com/10upsimon), [Volodymyr Kolesnykov (@sjinks)](https://github.com/sjinks), [Max Lyuchin (@cadic)](https://github.com/cadic), [Rahul Prajapati (@rahulsprajapati)](https://github.com/rahulsprajapati), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi). +[Mark Jaquith (@markjaquith)](https://github.com/markjaquith), [Ciprian Popescu (@wolffe)](https://github.com/wolffe), [Léo Colombaro (@LeoColomb)](https://github.com/LeoColomb), [Helen Hou-Sandi (@helen)](https://github.com/helen), [Vincenzo Russo (@vincenzo)](https://github.com/vincenzo), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Nikhil (@Nikschavan)](https://github.com/Nikschavan), [Niels Lange (@nielslange)](https://github.com/nielslange), [Stiofan O'Connor (@Stiofan)](https://github.com/Stiofan), [Sébastien SERRE (@sebastienserre)](https://github.com/sebastienserre), [Ram Ratan Maurya (@mauryaratan)](https://github.com/mauryaratan), [Johannes Siipola (@joppuyo)](https://github.com/joppuyo), [Felipe Elia (@felipeelia)](https://github.com/felipeelia), [Mobeen Abdullah (@mobeenabdullah)](https://github.com/mobeenabdullah), [Gaya Kessler (@Gaya)](https://github.com/Gaya), [Viktor Szépe (@szepeviktor)](https://github.com/szepeviktor), [Grégory Viguier (@Screenfeed)](https://github.com/Screenfeed), [Pascal Knecht (@pascalknecht)](https://github.com/pascalknecht), [Stanislav Khromov (@khromov)](https://github.com/khromov), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Jakub Mikita (@Kubitomakita)](https://github.com/Kubitomakita), [Lucas Bustamante (@Luc45)](https://github.com/Luc45), [Thien Nguyen (@tatthien-zz)](https://github.com/tatthien-zz), [Shiva Poudel (@shivapoudel)](https://github.com/shivapoudel), [null (@nextgenthemes)](https://github.com/nextgenthemes), [Tom Usborne (@tomusborne)](https://github.com/tomusborne), [dean shmuel (@deanshmuel)](https://github.com/deanshmuel), [Peter Adams (@padams)](https://github.com/padams), [Kevin Batdorf (@KevinBatdorf)](https://github.com/KevinBatdorf), [Q (@qstudio)](https://github.com/qstudio), [null (@om4csaba)](https://github.com/om4csaba), [Roman Sapezhko (@shmidtelson)](https://github.com/shmidtelson), [null (@luizkim)](https://github.com/luizkim), [René Hermenau (@rene-hermenau)](https://github.com/rene-hermenau), [Lewis Cowles (@Lewiscowles1986)](https://github.com/Lewiscowles1986), [Dominik Schilling (@ocean90)](https://github.com/ocean90), [Santiago Becerra (@sanbec)](https://github.com/sanbec), [Marijn Bent (@marijnbent)](https://github.com/marijnbent), [Jasan (@jasan-s)](https://github.com/jasan-s), [Dale Nguyen (@dalenguyen)](https://github.com/dalenguyen), [Darren Cooney (@dcooney)](https://github.com/dcooney), [Karolína Vyskočilová (@vyskoczilova)](https://github.com/vyskoczilova), [Rafał Sztwiorok (@sztwiorok)](https://github.com/sztwiorok), [Alec Rust (@AlecRust)](https://github.com/AlecRust), [Jonny Harris (@spacedmonkey)](https://github.com/spacedmonkey), [Doeke Norg (@doekenorg)](https://github.com/doekenorg), [Andrew Heberle (@andrewheberle)](https://github.com/andrewheberle), [Takashi Hosoya (@tkc49)](https://github.com/tkc49), [Fabian Marz (@fabianmarz)](https://github.com/fabianmarz), [David Herron (@robogeek)](https://github.com/robogeek), [Sergey Kotlov (@sery0ga)](https://github.com/sery0ga), [Samuel Wood (@Otto42)](https://github.com/Otto42), [IgorChernenko (@igorchernenko92)](https://github.com/igorchernenko92), [Richard Muvirimi (@richard-muvirimi)](https://github.com/richard-muvirimi), [Dani Llewellyn (@diddledani)](https://github.com/diddledani), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Mukesh Panchal (@mukeshpanchal27)](https://github.com/mukeshpanchal27), [Joe McGill (@joemcgill)](https://github.com/joemcgill), [Felix Arntz (@felixarntz)](https://github.com/felixarntz), [Evan Mattson (@aaemnnosttv)](https://github.com/aaemnnosttv), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Stephanie Wells (@stephywells)](https://github.com/stephywells), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Jason Adams (@JasonTheAdams)](https://github.com/JasonTheAdams), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Uriahs Victor (@UVLabs)](https://github.com/UVLabs), [Simon Dowdles (@10upsimon)](https://github.com/10upsimon), [Volodymyr Kolesnykov (@sjinks)](https://github.com/sjinks), [Max Lyuchin (@cadic)](https://github.com/cadic), [Rahul Prajapati (@rahulsprajapati)](https://github.com/rahulsprajapati), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Alex Kirk (@akirk)](https://github.com/akirk), [Lu Fei (@sy-records)](https://github.com/sy-records). ## Libraries diff --git a/deploy.sh b/deploy.sh index 3102283..a843ba7 100755 --- a/deploy.sh +++ b/deploy.sh @@ -66,9 +66,26 @@ svn update --set-depth infinity assets svn update --set-depth infinity trunk svn update --set-depth immediates tags +generate_zip() { + if $INPUT_GENERATE_ZIP; then + echo "Generating zip file..." + + # use a symbolic link so the directory in the zip matches the slug + ln -s "${SVN_DIR}/trunk" "${SVN_DIR}/${SLUG}" + zip -r "${GITHUB_WORKSPACE}/${SLUG}.zip" "$SLUG" + unlink "${SVN_DIR}/${SLUG}" + + echo "zip-path=${GITHUB_WORKSPACE}/${SLUG}.zip" >> "${GITHUB_OUTPUT}" + echo "✓ Zip file generated!" + fi +} + # Bail early if the plugin version is already published. if [[ -d "tags/$VERSION" ]]; then echo "ℹ︎ Version $VERSION of plugin $SLUG was already published"; + + generate_zip + exit fi @@ -96,6 +113,11 @@ if [[ "$BUILD_DIR" = false ]]; then git config --global user.email "10upbot+github@10up.com" git config --global user.name "10upbot on GitHub" + # Ensure git archive will pick up any changed files in the directory try. + test $(git ls-files --deleted) && git rm $(git ls-files --deleted) + git add . + git commit -m "Include build step changes" + # If there's no .gitattributes file, write a default one into place if [[ ! -e "$GITHUB_WORKSPACE/.gitattributes" ]]; then cat > "$GITHUB_WORKSPACE/.gitattributes" <<-EOL @@ -173,16 +195,6 @@ else svn commit -m "Update to version $VERSION from GitHub" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" fi -if $INPUT_GENERATE_ZIP; then - echo "Generating zip file..." - - # use a symbolic link so the directory in the zip matches the slug - ln -s "${SVN_DIR}/trunk" "${SVN_DIR}/${SLUG}" - zip -r "${GITHUB_WORKSPACE}/${SLUG}.zip" "$SLUG" - unlink "${SVN_DIR}/${SLUG}" - - echo "zip-path=${GITHUB_WORKSPACE}/${SLUG}.zip" >> "${GITHUB_OUTPUT}" - echo "✓ Zip file generated!" -fi +generate_zip echo "✓ Plugin deployed!"